Skip to content

Commit 11d4554

Browse files
revert
1 parent d77156e commit 11d4554

File tree

2 files changed

+48
-9
lines changed

2 files changed

+48
-9
lines changed

.github/workflows/fake-release.yaml

+12-9
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,50 @@ on:
88
required: true
99
description: 'Version number (for example: 0.1.0)'
1010
push:
11-
branches:
12-
- test-odh-notebooks-sync
11+
branches: [ main ]
1312

1413
env:
15-
BRANCH_NAME: main
1614
PR_BRANCH_NAME: snyk-tag-monitoring-${{ github.run_id }}
17-
GITHUB_TOKEN: ${{ secrets.GH_CLI_TOKEN }}
1815
RELEASE_VERSION: ${{ github.event.inputs.release-version || '0.2.0' }}
1916

2017
jobs:
2118
release:
2219
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
pull-requests: write
2323
steps:
2424
- name: Checkout code
2525
uses: actions/checkout@v4
2626
with:
2727
submodules: recursive
28+
token: ${{ secrets.GH_CLI_TOKEN }}
2829

2930
- name: Append tag to Snyk monitoring list
3031
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
3233
3334
- name: Commit and push changes
3435
run: |
3536
git config --global user.email "[email protected]"
3637
git config --global user.name "codeflare-machine-account"
3738
git checkout -b $PR_BRANCH_NAME
3839
git commit -am "Update snyk-security.yaml"
39-
git push origin $PR_BRANCH_NAME
40+
git push --set-upstream origin "$PR_BRANCH_NAME"
4041
4142
- name: Create Pull Request
4243
run: |
4344
gh pr create \
4445
--title "$pr_title" \
4546
--body "$pr_body" \
4647
--head ${{ env.PR_BRANCH_NAME }} \
47-
--base "$GIT_BRANCH"
48+
--base main \
49+
--label "lgtm" \
50+
--label "approved"
4851
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"
5054
pr_body: |
5155
: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.
5256
5357
This PR appends to the list of tags that Snyk will be monitoring.
54-
GIT_BRANCH: ${GITHUB_REF#refs/heads/}

.github/workflows/release.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,22 @@ on:
2727
type: string
2828
default: "project-codeflare"
2929

30+
env:
31+
PR_BRANCH_NAME: snyk-tag-monitoring-${{ github.run_id }}
32+
3033
jobs:
3134
release:
3235
runs-on: ubuntu-latest
3336
permissions:
3437
contents: write
3538
id-token: write # This permission is required for trusted publishing
39+
pull-requests: write # This permission is required for creating PRs
3640
steps:
3741
- name: Checkout the repository
3842
uses: actions/checkout@v4
43+
with:
44+
submodules: recursive
45+
token: ${{ secrets.GH_CLI_TOKEN }}
3946
- name: Install Python
4047
uses: actions/setup-python@v5
4148
with:
@@ -81,3 +88,32 @@ jobs:
8188
env:
8289
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
8390
shell: bash
91+
92+
- name: Append tag to Snyk monitoring list
93+
run: |
94+
sed -i 's/list_of_released_tags=(/list_of_released_tags=("v${{ github.event.inputs.release-version }}", /' .github/workflows/snyk-security.yaml
95+
96+
- name: Commit and push changes
97+
run: |
98+
git config --global user.email "[email protected]"
99+
git config --global user.name "codeflare-machine-account"
100+
git checkout -b $PR_BRANCH_NAME
101+
git commit -am "Update snyk-security.yaml"
102+
git push --set-upstream origin "$PR_BRANCH_NAME"
103+
104+
- name: Create Pull Request
105+
run: |
106+
gh pr create \
107+
--title "$pr_title" \
108+
--body "$pr_body" \
109+
--head ${{ env.PR_BRANCH_NAME }} \
110+
--base main \
111+
--label "lgtm" \
112+
--label "approved"
113+
env:
114+
GITHUB_TOKEN: ${{ secrets.GH_CLI_TOKEN }}
115+
pr_title: "[CodeFlare-Machine] Append tag v${{ github.event.inputs.release-version }} to Snyk monitoring list"
116+
pr_body: |
117+
: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.
118+
119+
This PR appends to the list of tags that Snyk will be monitoring.

0 commit comments

Comments
 (0)