Merge pull request #123 from Expensify/andrew-shared-publish #28
This file contains 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: Publish package to npmjs | |
# This workflow runs when code is pushed to `main` (i.e: when a pull request is merged) | |
on: | |
push: | |
branches: [main] | |
# Ensure that only once instance of this workflow executes at a time. | |
# If multiple PRs are merged in quick succession, there will only ever be one publish workflow running and one pending. | |
concurrency: ${{ github.workflow }} | |
jobs: | |
get_pull_request: | |
runs-on: ubuntu-latest | |
outputs: | |
pull_request_number: ${{ steps.getMergedPullRequest.outputs.pull_request_number }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Get merged pull request | |
id: getMergedPullRequest | |
uses: actions-ecosystem/action-get-merged-pull-request@59afe90821bb0b555082ce8ff1e36b03f91553d9 | |
with: | |
github_token: ${{ github.token }} | |
publish: | |
needs: get_pull_request | |
uses: Expensify/GitHub-Actions/.github/workflows/npmPublish.yml@main | |
with: | |
repository: ${{ github.action_repository }} | |
pull_request_number: ${{ needs.get_pull_request.outputs.pull_request_number }} | |
secrets: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
OS_BOTIFY_COMMIT_TOKEN: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }} |