Version Packages #54
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run - Publisher | |
| on: | |
| # Triggers the workflow on pull request events but only for the main branch | |
| pull_request: | |
| branches: [main] | |
| types: [closed] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| inputs: | |
| COMMIT_ID_CHOICE: | |
| description: 'Choose "publish-all-artifacts-in-repo" only when you want to force republishing all artifacts (e.g. after build failure). Otherwise stick with the default behavior of "publish-artifacts-in-last-commit"' | |
| required: true | |
| type: choice | |
| default: "publish-artifacts-in-last-commit" | |
| options: | |
| - "publish-artifacts-in-last-commit" | |
| - "publish-all-artifacts-in-repo" | |
| permissions: | |
| id-token: write | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| get-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Set the COMMIT_ID env variable | |
| - name: Set the Commit Id | |
| id: commit | |
| run: echo "commit_id=${GITHUB_SHA}" >> $GITHUB_ENV | |
| outputs: | |
| commit_id: ${{ steps.commit.outputs.commit_id }} | |
| #Publish with Commit ID | |
| Push-Changes-To-APIM-Dev-With-Commit-ID: | |
| if: (github.event.inputs.COMMIT_ID_CHOICE == 'publish-artifacts-in-last-commit' || github.event.inputs.COMMIT_ID_CHOICE == '') | |
| needs: get-commit | |
| uses: ./.github/workflows/run-publisher-with-env.yaml | |
| with: | |
| API_MANAGEMENT_ENVIRONMENT: dev # change this to match the dev environment created in settings | |
| COMMIT_ID: ${{ needs.get-commit.outputs.commit_id }} | |
| API_MANAGEMENT_SERVICE_OUTPUT_FOLDER_PATH: apimartifacts # change this to the artifacts folder | |
| secrets: inherit | |
| #Publish without Commit ID. Publishes all artifacts that reside in the artifacts forlder | |
| Push-Changes-To-APIM-Dev-Without-Commit-ID: | |
| if: ( github.event.inputs.COMMIT_ID_CHOICE == 'publish-all-artifacts-in-repo' ) | |
| needs: get-commit | |
| uses: ./.github/workflows/run-publisher-with-env.yaml | |
| with: | |
| API_MANAGEMENT_ENVIRONMENT: dev # change this to match the dev environment created in settings | |
| API_MANAGEMENT_SERVICE_OUTPUT_FOLDER_PATH: apimartifacts # change this to the artifacts folder | |
| secrets: inherit |