Skip to content

Commit edc2d7b

Browse files
committed
check purls action
1 parent ad444c4 commit edc2d7b

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: Update PURLs list for dependabot prs
3+
4+
on:
5+
pull_request
6+
7+
permissions:
8+
pull-requests: write
9+
contents: write
10+
repository-projects: read
11+
jobs:
12+
update-purls:
13+
name: Update PURLs
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
17+
with:
18+
config: ${{ vars.PERMISSIONS_CONFIG }}
19+
- name: Checkout code
20+
uses: actions/[email protected]
21+
with:
22+
ref: ${{ github.head_ref }}
23+
fetch-depth: 0
24+
- uses: actions/setup-go@v5
25+
with:
26+
go-version-file: 'go.mod'
27+
- run: make gen-purls
28+
- name: Set Apix Bot token
29+
id: app-token
30+
uses: mongodb/apix-action/token@3024080388613583e3bd119bfb1ab4b4dbf43c42
31+
with:
32+
app-id: ${{ secrets.APIXBOT_APP_ID }}
33+
private-key: ${{ secrets.APIXBOT_APP_PEM }}
34+
- name: Commit updated purls.txt if changed
35+
env:
36+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
37+
BRANCH_NAME: ${{ github.head_ref }}
38+
run: |
39+
echo "Changes to purls.txt:"
40+
if git diff --exit-code build/package/purls.txt; then
41+
echo "No changes to purls.txt"
42+
else
43+
git config --global user.name "${{ steps.app-token.outputs.user-name }}"
44+
git config --global user.email "${{ steps.app-token.outputs.user-email }}"
45+
git add build/package/purls.txt
46+
git commit -m "chore: update purls.txt"
47+
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}"
48+
git push origin "$BRANCH_NAME"
49+
fi

0 commit comments

Comments
 (0)