File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 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/checkout@v4.1.1
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
You can’t perform that action at this time.
0 commit comments