diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cebd29bbe..07c88ebf1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,15 +13,26 @@ on: permissions: contents: write +# This action requires a GitHub app with content write access installed +# to bypass the main branch protection rule and dispatch the event to a different repo jobs: release: runs-on: ubuntu-latest - outputs: - VERSION_NUMBER: ${{ steps.git-release.outputs.VERSION_NUMBER }} steps: + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PEM }} + owner: ${{ github.repository_owner }} + repositories: | + veda-ui + veda-config - uses: actions/checkout@v4 with: fetch-depth: 0 + token: ${{ steps.generate-token.outputs.token }} - name: git config run: | git config user.name "${GITHUB_ACTOR}" @@ -36,24 +47,10 @@ jobs: run: yarn release --ci --verbose env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - preview-build: - runs-on: ubuntu-latest - needs: "release" - steps: - - name: Generate a token - id: generate-token - uses: actions/create-github-app-token@v1 - with: - app-id: ${{ secrets.APP_ID }} - private-key: ${{ secrets.APP_PEM }} - owner: ${{ github.repository_owner }} - repositories: | - veda-ui - veda-config - name: Repository Dispatch uses: peter-evans/repository-dispatch@v3 with: token: ${{steps.generate-token.outputs.token}} repository: nasa-impact/veda-config event-type: update-version - client-payload: '{"ref": "${{ github.ref }}", "VERSION_NUMBER": "${{ needs.release.outputs.VERSION_NUMBER || inputs.VERSION_NUMBER }}"}' \ No newline at end of file + client-payload: '{"ref": "${{ github.ref }}", "VERSION_NUMBER": "${{ steps.git-release.outputs.VERSION_NUMBER || inputs.VERSION_NUMBER }}"}' \ No newline at end of file