Skip to content

Commit d77156e

Browse files
next
1 parent 513645a commit d77156e

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

.github/workflows/fake-release.yaml

+15-11
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ on:
1313

1414
env:
1515
BRANCH_NAME: main
16-
UPDATER_BRANCH: snyk-tag-monitoring-${{ github.run_id }}
17-
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
16+
PR_BRANCH_NAME: snyk-tag-monitoring-${{ github.run_id }}
17+
GITHUB_TOKEN: ${{ secrets.GH_CLI_TOKEN }}
18+
RELEASE_VERSION: ${{ github.event.inputs.release-version || '0.2.0' }}
1819

1920
jobs:
2021
release:
@@ -27,24 +28,27 @@ jobs:
2728

2829
- name: Append tag to Snyk monitoring list
2930
run: |
30-
sed -i 's/list_of_released_tags=(/list_of_released_tags=("${{ github.event.inputs.release-version }}", /' .github/workflows/snyk-security.yaml
31+
sed -i 's/list_of_released_tags=(/list_of_released_tags=("v$RELEASE_VERSION", /' .github/workflows/snyk-security.yaml
3132
32-
- name: Push changes
33+
- name: Commit and push changes
3334
run: |
34-
git add . && git status && git checkout -b ${{ env.UPDATER_BRANCH }} && \
35-
git commit -am "Updated notebooks via ${{ env.UPDATER_BRANCH }} GitHub action" && \
36-
git push origin ${{ env.UPDATER_BRANCH }}
35+
git config --global user.email "[email protected]"
36+
git config --global user.name "codeflare-machine-account"
37+
git checkout -b $PR_BRANCH_NAME
38+
git commit -am "Update snyk-security.yaml"
39+
git push origin $PR_BRANCH_NAME
3740
3841
- name: Create Pull Request
3942
run: |
40-
gh pr create --repo project-codeflare/codeflare-sdk \
43+
gh pr create \
4144
--title "$pr_title" \
4245
--body "$pr_body" \
43-
--head $UPDATER_BRANCH \
44-
--base $BRANCH_NAME
46+
--head ${{ env.PR_BRANCH_NAME }} \
47+
--base "$GIT_BRANCH"
4548
env:
46-
pr_title: "Append tag ${{ github.event.inputs.release-version }} to Snyk monitoring list"
49+
pr_title: "Append tag $RELEASE_VERSION to Snyk monitoring list"
4750
pr_body: |
4851
: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.
4952
5053
This PR appends to the list of tags that Snyk will be monitoring.
54+
GIT_BRANCH: ${GITHUB_REF#refs/heads/}

0 commit comments

Comments
 (0)