diff --git a/.github/workflows/initial_release.yml b/.github/workflows/initial_release.yml index 0cc514b..bf20e9b 100644 --- a/.github/workflows/initial_release.yml +++ b/.github/workflows/initial_release.yml @@ -49,6 +49,8 @@ jobs: with: variables: "MAIN_BRANCH,MINOR_BUMP_LABEL,PATCH_BUMP_LABEL,PROJECT_NAME" repo: ${{ github.repository }} + secrets: + gh_token: ${{ secrets.token }} # TODO Move release query logic into github action diff --git a/.github/workflows/release_trigger.yml b/.github/workflows/release_trigger.yml index d107c07..57770a1 100644 --- a/.github/workflows/release_trigger.yml +++ b/.github/workflows/release_trigger.yml @@ -46,6 +46,8 @@ jobs: with: variables: "MAIN_BRANCH,MINOR_BUMP_LABEL,PATCH_BUMP_LABEL,PROJECT_NAME" repo: ${{ github.repository }} + secrets: + gh_token: ${{ secrets.token }} # TODO Move release query logic into github action diff --git a/.github/workflows/verify_secrets.yml b/.github/workflows/verify_secrets.yml index ec50535..a2d5752 100644 --- a/.github/workflows/verify_secrets.yml +++ b/.github/workflows/verify_secrets.yml @@ -30,22 +30,22 @@ jobs: # TODO only check if no inputs provided steps: - - name: 🔎 Verify secret 'GH_TOKEN' for ${{ env.GH_REPO }} + - name: Verify secret 'GH_TOKEN' for ${{ env.GH_REPO }} if: ${{ !env.GH_TOKEN }} run: | echo "::error::Secret 'GH_TOKEN' is not set or empty" - - name: 🔎 Verify secret 'GH_USER' for ${{ env.GH_REPO }} + - name: Verify secret 'GH_USER' for ${{ env.GH_REPO }} if: ${{ !env.GH_USER }} run: | echo "::error::Secret 'GH_USER' is not set or empty" - - name: 🔎 Verify secret 'GH_EMAIL' for ${{ env.GH_REPO }} + - name: Verify secret 'GH_EMAIL' for ${{ env.GH_REPO }} if: ${{ !env.GH_EMAIL }} run: | echo "::error::Secret 'GH_EMAIL' is not set or empty" - - name: 🔎 Secrets verified + - name: Secrets verified if: ${{ env.GH_TOKEN && env.GH_USER && env.GH_EMAIL }} run: | echo "::notice::All required secrets are present." diff --git a/.github/workflows/verify_variables.yml b/.github/workflows/verify_variables.yml index d8fabc4..e33dadc 100644 --- a/.github/workflows/verify_variables.yml +++ b/.github/workflows/verify_variables.yml @@ -10,17 +10,22 @@ on: repo: type: string required: false + + secrets: + gh_token: + required: true env: REPO_VARS: ${{ secrets.gh_token || false }} GH_REPO : ${{ inputs.repo || github.repository }} + GH_TOKEN: ${{ secrets.gh_token }} jobs: verify_variables: runs-on: ubuntu-latest steps: - - name: 🔎 Verify repo variables for ${{ env.GH_REPO }} + - name: Verify repo variables for ${{ env.GH_REPO }} run: | missing_vars=$(echo ${{ env.REPO_VARS }} | tr ',' '\n' | while read var; do gh variable list --repo ${{ env.GH_REPO }} --json name --jq '.[].name' | grep -qx "$var" || echo "$var"