Skip to content

Commit

Permalink
address some review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Jan 25, 2024
1 parent cf9db6e commit 732b253
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/bump-sec-scanners-config-reusable.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is a reusbale workflow to bump the 'sec-scanners-config.yaml'
# This is a reusable workflow to bump the 'sec-scanners-config.yaml'
#
# It will do so by using the script `hack/scripts/render-sec-scanners-config.sh`, that is not part of the workflow.
# If you want to run this workflow against a repo the script must exist in that repo. This is by design, because every repo
Expand Down Expand Up @@ -82,16 +82,18 @@ jobs:
echo "No changes found. No need to create a PR"
else
echo "Changes found. Creating a PR and waiting for it to be merged."
echo "create_pr=true" >> $GITHUB_ENV
echo "CREATE_PR=true" >> $GITHUB_ENV
fi
- name: Print Content of sec-scanners-config.yaml
if: ${{ env.create_pr == 'true' }}
if: ${{ always() }}
shell: bash
run: cat sec-scanners-config.yaml
run: |
FILE="sec-scanners-config.yaml"
[ -f "${FILE}" ] && cat "${FILE}" || echo "${FILE} not found."
- name: Set Up Git
if: ${{ env.create_pr == 'true' }}
if: ${{ env.CREATE_PR == 'true' }}
env:
GH_TOKEN: ${{ secrets.BOT_PAT }}
shell: bash
Expand All @@ -106,7 +108,7 @@ jobs:
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${REPO}.git"
- name: Set All Variables
if: ${{ env.create_pr == 'true' }}
if: ${{ env.CREATE_PR == 'true' }}
shell: bash
run: |
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
Expand All @@ -122,7 +124,7 @@ jobs:
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
- name: Create a Pull Request
if: ${{ env.create_pr == 'true' }}
if: ${{ env.CREATE_PR == 'true' }}
env:
CURRENT_BRANCH: ${{ env.CURRENT_BRANCH }}
PR_DATE: ${{ env.PR_DATE }}
Expand All @@ -146,15 +148,15 @@ jobs:
echo "PR_URL=${PR_URL}" >> $GITHUB_ENV
- name: USER INTERACTION REQUIRED
if: ${{ env.create_pr == 'true' }}
if: ${{ env.CREATE_PR == 'true' }}
shell: bash
env:
PR_URL: ${{ env.PR_URL }}
run: |
echo "please review ${PR_URL}"
- name: Wait for PR to be Merged
if: ${{ env.create_pr == 'true' }}
if: ${{ env.CREATE_PR == 'true' }}
shell: bash
env:
TIMEOUT: ${{ inputs.timeout }}
Expand Down

0 comments on commit 732b253

Please sign in to comment.