CLOUDP-319582: Run gen-purl as part of dependabot workflow #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Update PURLs list for dependabot prs | |
| on: | |
| pull_request | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| repository-projects: read | |
| jobs: | |
| update-purls: | |
| name: Update PURLs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: GitHubSecurityLab/actions-permissions/monitor@v1 | |
| with: | |
| config: ${{ vars.PERMISSIONS_CONFIG }} | |
| - name: Checkout code | |
| uses: actions/checkout@v4.1.1 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24.2' | |
| - name: Run Make Command | |
| run: | | |
| make gen-purls | |
| - name: Set up Git config | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Commit updated purls.txt if changed | |
| env: | |
| BRANCH_NAME: ${{ github.head_ref }} | |
| run: | | |
| echo "Changes to purls.txt:" | |
| if git diff --exit-code build/package/purls.txt; then | |
| echo "No changes to purls.txt" | |
| else | |
| git add build/package/purls.txt | |
| git commit -m "chore: update purls.txt" | |
| git push origin "$BRANCH_NAME" | |
| fi |