|
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 |
| - BRANCH_NAME: main |
16 | 14 | PR_BRANCH_NAME: snyk-tag-monitoring-${{ github.run_id }}
|
17 |
| - GITHUB_TOKEN: ${{ secrets.GH_CLI_TOKEN }} |
18 | 15 | RELEASE_VERSION: ${{ github.event.inputs.release-version || '0.2.0' }}
|
19 | 16 |
|
20 | 17 | jobs:
|
21 | 18 | release:
|
22 | 19 | runs-on: ubuntu-latest
|
| 20 | + permissions: |
| 21 | + contents: write |
| 22 | + pull-requests: write |
23 | 23 | steps:
|
24 | 24 | - name: Checkout code
|
25 | 25 | uses: actions/checkout@v4
|
26 | 26 | with:
|
27 | 27 | submodules: recursive
|
| 28 | + token: ${{ secrets.GH_CLI_TOKEN }} |
28 | 29 |
|
29 | 30 | - name: Append tag to Snyk monitoring list
|
30 | 31 | run: |
|
31 |
| - sed -i 's/list_of_released_tags=(/list_of_released_tags=("v$RELEASE_VERSION", /' .github/workflows/snyk-security.yaml |
| 32 | + sed -i 's/list_of_released_tags=(/list_of_released_tags=("v${{ github.event.inputs.release-version }}", /' .github/workflows/snyk-security.yaml |
32 | 33 |
|
33 | 34 | - name: Commit and push changes
|
34 | 35 | run: |
|
35 | 36 | git config --global user.email "[email protected]"
|
36 | 37 | git config --global user.name "codeflare-machine-account"
|
37 | 38 | git checkout -b $PR_BRANCH_NAME
|
38 | 39 | git commit -am "Update snyk-security.yaml"
|
39 |
| - git push origin $PR_BRANCH_NAME |
| 40 | + git push --set-upstream origin "$PR_BRANCH_NAME" |
40 | 41 |
|
41 | 42 | - name: Create Pull Request
|
42 | 43 | run: |
|
43 | 44 | gh pr create \
|
44 | 45 | --title "$pr_title" \
|
45 | 46 | --body "$pr_body" \
|
46 | 47 | --head ${{ env.PR_BRANCH_NAME }} \
|
47 |
| - --base "$GIT_BRANCH" |
| 48 | + --base main \ |
| 49 | + --label "lgtm" \ |
| 50 | + --label "approved" |
48 | 51 | env:
|
49 |
| - pr_title: "Append tag $RELEASE_VERSION to Snyk monitoring list" |
| 52 | + GITHUB_TOKEN: ${{ secrets.GH_CLI_TOKEN }} |
| 53 | + pr_title: "[CodeFlare-Machine] Append tag v${{ github.event.inputs.release-version }} to Snyk monitoring list" |
50 | 54 | pr_body: |
|
51 | 55 | :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 | 56 |
|
53 | 57 | This PR appends to the list of tags that Snyk will be monitoring.
|
54 |
| - GIT_BRANCH: ${GITHUB_REF#refs/heads/} |
|
0 commit comments