Run on main #12
Workflow file for this run
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: Test | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize, labeled] | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
name: Add the 'test' label to the PR to run the required test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- uses: ./ | |
name: Setup | |
id: setup | |
with: | |
build: npm run format && npm run test && npm run build | |
- name: Run prNumber | |
id: prNumber | |
if: github.event_name == 'pull_request' | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
function: prNumber | |
- name: Validate result | |
if: github.event_name == 'pull_request' | |
run: | | |
echo "PR number is ${{ steps.prNumber.outputs.result }}" | |
- name: Get label | |
if: github.event.act != 'true' && github.event_name == 'pull_request' | |
id: getLabel | |
uses: ./ | |
env: | |
PR_NUMBER: ${{ steps.prNumber.outputs.result }} | |
LABEL: "test" | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
function: getLabel | |
- if: github.event.act != 'true' && github.event_name == 'pull_request' | |
run: | | |
[ "${{ steps.getLabel.outputs.result }}" == "test" ] |