Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add bot-check to test-action.yml #373

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,33 @@ on:
types: [ opened, synchronize, reopened, ready_for_review ]

jobs:
should-workflow-run:
runs-on: ubuntu-latest
steps:
- if: >
!github.event.pull_request.draft && !(
(github.actor == 'asyncapi-bot' && (
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') ||
startsWith(github.event.pull_request.title, 'chore(release):')
)) ||
(github.actor == 'asyncapi-bot-eve' && (
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') ||
startsWith(github.event.pull_request.title, 'chore(release):')
)) ||
(github.actor == 'allcontributors[bot]' &&
startsWith(github.event.pull_request.title, 'docs: add')
)
)
id: should_run
name: Should Run
run: echo "shouldrun=true" >> $GITHUB_OUTPUT
outputs:
shouldrun: ${{ steps.should_run.outputs.shouldrun }}

test-defaults:
if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }}
runs-on: ubuntu-latest
needs: should-workflow-run
steps:
- uses: actions/checkout@v4
- name: Test GitHub Action
Expand All @@ -27,7 +52,9 @@ jobs:
fi

test-validate-success:
if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }}
runs-on: ubuntu-latest
needs: should-workflow-run
steps:
- uses: actions/checkout@v4
- name: Test GitHub Action
Expand All @@ -37,7 +64,9 @@ jobs:
command: validate

test-custom-command:
if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }}
runs-on: ubuntu-latest
needs: should-workflow-run
steps:
- uses: actions/checkout@v4
- name: Test GitHub Action
Expand All @@ -60,7 +89,9 @@ jobs:
fi

test-custom-output:
if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }}
runs-on: ubuntu-latest
needs: should-workflow-run
steps:
- uses: actions/checkout@v4
- name: Test GitHub Action
Expand All @@ -82,7 +113,9 @@ jobs:
fi

test-file-not-found:
if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }}
runs-on: ubuntu-latest
needs: should-workflow-run
steps:
- uses: actions/checkout@v4
- name: Test GitHub Action
Expand All @@ -101,7 +134,9 @@ jobs:
fi

test-invalid-input:
if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }}
runs-on: ubuntu-latest
needs: should-workflow-run
steps:
- uses: actions/checkout@v4
- name: Test GitHub Action
Expand All @@ -122,7 +157,9 @@ jobs:
fi

test-optimize:
if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }}
runs-on: ubuntu-latest
needs: should-workflow-run
steps:
- uses: actions/checkout@v4
- name: Test GitHub Action
Expand All @@ -145,7 +182,9 @@ jobs:
fi

test-bundle:
if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }}
runs-on: ubuntu-latest
needs: should-workflow-run
steps:
- uses: actions/checkout@v4
- name: Make output directory
Expand All @@ -168,7 +207,9 @@ jobs:
fi

test-convert:
if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }}
runs-on: ubuntu-latest
needs: should-workflow-run
steps:
- uses: actions/checkout@v4
- name: Test GitHub Action
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"test": "make test",
"generate:assets": "echo 'No additional assets need to be generated at the moment'",
"docker:build": "docker build -t asyncapi/github-action-for-cli:latest ."
"docker:build": "docker build -t asyncapi/github-action-for-cli:latest .",
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION"
},
"repository": {
"type": "git",
Expand Down
Loading