Skip to content

Commit

Permalink
ci: add commit_hash to force checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasbrugneaux committed Mar 28, 2024
1 parent bc2c6cb commit 9f471a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ on:
schedule:
# Daily at 9AM
- cron: "0 9 * * *"


jobs:
update_ofac_list:
runs-on: ubuntu-latest
outputs:
GIT_EXIT_CODE: ${{ steps.diff_flag.outputs.GIT_EXIT_CODE }}
NEW_COMMIT_HASH: ${{ steps.commit.outputs.commit_hash }}
permissions:
id-token: write

steps:
- name: Get GitHub Token from Akeyless
id: get_github_token
uses:
docker://us-west1-docker.pkg.dev/devopsre/akeyless-public/akeyless-action:latest
uses: docker://us-west1-docker.pkg.dev/devopsre/akeyless-public/akeyless-action:latest
with:
api-url: https://api.gateway.akeyless.celo-networks-dev.org
access-id: p-kf9vjzruht6l
Expand All @@ -46,10 +45,13 @@ jobs:
echo "GIT_EXIT_CODE=$GIT_EXIT_CODE" >> $GITHUB_OUTPUT >> $GITHUB_OUTPUT
- uses: stefanzweifel/git-auto-commit-action@v5
id: commit
with:
commit_message: "auto: Add new OFAC addresses"

publish-npm-package:
needs: update_ofac_list
if: ${{ needs.update_ofac_list.outputs.GIT_EXIT_CODE == 1 }}
uses: celo-org/compliance/.github/workflows/publish.yml@main
with:
commit_hash: ${{ needs.update_ofac_list.outputs.NEW_COMMIT_HASH }}
12 changes: 12 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@ name: Publish Package to npmjs

on:
workflow_call:
inputs:
commit_hash:
description: "Commit to checkout and to publish"
required: true
type: string
workflow_dispatch:
inputs:
commit_hash:
description: "Commit to checkout and to publish"
required: true
type: string

jobs:
publish:
Expand All @@ -15,6 +25,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_hash }}

- name: Get NPM Token from Akeyless
id: get_npmjs_token
Expand Down

0 comments on commit 9f471a1

Please sign in to comment.