Skip to content

Commit

Permalink
Merge pull request #5 from urcomputeringpal/run-on-main
Browse files Browse the repository at this point in the history
Run on main
  • Loading branch information
jnewland committed May 13, 2023
2 parents 3227e1b + f5d567f commit 41fd327
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Test
name: test
on:
pull_request:
types: [opened, reopened, synchronize, labeled]
push:
branches:
- main

jobs:
prepare:
runs-on: ubuntu-latest
steps:
- run: "true"

test:
needs: prepare
name: |
${{ contains(github.event.pull_request.labels.*.name, 'test') && 'test' || 'add the "test" label to the PR to run the required test' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -23,17 +23,19 @@ jobs:

- 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'
if: github.event.act != 'true' && github.event_name == 'pull_request'
id: getLabel
uses: ./
env:
Expand All @@ -43,6 +45,6 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
function: getLabel

- if: github.event.act != 'true'
- if: github.event.act != 'true' && github.event_name == 'pull_request'
run: |
[ "${{ steps.getLabel.outputs.result }}" == "test" ]

0 comments on commit 41fd327

Please sign in to comment.