|
8 | 8 | required: true |
9 | 9 | description: 'Version number (for example: 0.1.0)' |
10 | 10 | push: |
11 | | - branches: |
12 | | - - test-odh-notebooks-sync |
| 11 | + branches: [ main ] |
13 | 12 |
|
14 | 13 | env: |
15 | 14 | BRANCH_NAME: main |
16 | 15 | PR_BRANCH_NAME: snyk-tag-monitoring-${{ github.run_id }} |
17 | | - GITHUB_TOKEN: ${{ secrets.GH_CLI_TOKEN }} |
18 | 16 | RELEASE_VERSION: ${{ github.event.inputs.release-version || '0.2.0' }} |
19 | 17 |
|
20 | 18 | jobs: |
21 | 19 | release: |
22 | 20 | runs-on: ubuntu-latest |
| 21 | + permissions: |
| 22 | + contents: write |
| 23 | + pull-requests: write |
23 | 24 | steps: |
24 | 25 | - name: Checkout code |
25 | 26 | uses: actions/checkout@v4 |
26 | 27 | with: |
27 | 28 | submodules: recursive |
| 29 | + token: ${{ secrets.GH_CLI_TOKEN }} |
28 | 30 |
|
29 | 31 | - name: Append tag to Snyk monitoring list |
30 | 32 | run: | |
31 | | - sed -i 's/list_of_released_tags=(/list_of_released_tags=("v$RELEASE_VERSION", /' .github/workflows/snyk-security.yaml |
| 33 | + sed -i 's/list_of_released_tags=(/list_of_released_tags=("v${{ env.RELEASE_VERSION }}", /' .github/workflows/snyk-security.yaml |
32 | 34 |
|
33 | 35 | - name: Commit and push changes |
34 | 36 | run: | |
35 | 37 | git config --global user.email "[email protected]" |
36 | 38 | git config --global user.name "codeflare-machine-account" |
37 | 39 | git checkout -b $PR_BRANCH_NAME |
38 | 40 | git commit -am "Update snyk-security.yaml" |
39 | | - git push origin $PR_BRANCH_NAME |
| 41 | + git push --set-upstream origin "$PR_BRANCH_NAME" |
40 | 42 |
|
41 | 43 | - name: Create Pull Request |
42 | 44 | run: | |
43 | 45 | gh pr create \ |
44 | 46 | --title "$pr_title" \ |
45 | 47 | --body "$pr_body" \ |
46 | 48 | --head ${{ env.PR_BRANCH_NAME }} \ |
47 | | - --base "$GIT_BRANCH" |
| 49 | + --base main |
48 | 50 | env: |
49 | | - pr_title: "Append tag $RELEASE_VERSION to Snyk monitoring list" |
| 51 | + GITHUB_TOKEN: ${{ secrets.GH_CLI_TOKEN }} |
| 52 | + pr_title: "Append tag ${{ env.RELEASE_VERSION }} to Snyk monitoring list" |
50 | 53 | pr_body: | |
51 | 54 | :rocket: This is an automated Pull Request generated by [release.yaml](https://github.com/project-codeflare/codeflare-sdk/blob/main/.github/workflows/release.yaml) workflow. |
52 | 55 |
|
53 | 56 | This PR appends to the list of tags that Snyk will be monitoring. |
54 | | - GIT_BRANCH: ${GITHUB_REF#refs/heads/} |
|
0 commit comments