test: dummy PR #32
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: Custom trigger test | |
on: | |
issue_comment: | |
types: [created] | |
jobs: | |
test: | |
if: github.event.issue.pull_request && github.event.comment.body == '/test' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get the PR branch | |
uses: xt0rted/pull-request-comment-branch@v2 | |
id: comment-branch | |
- name: Set latest commit status as pending | |
if : ${{ success() }} | |
uses: myrotvorets/set-commit-status-action@master | |
with: | |
sha: ${{ steps.comment-branch.outputs.head_sha }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
status: pending | |
# - name: Checkout | |
# if : ${{ success() }} | |
# uses: actions/checkout@v3 | |
# with: | |
# ref: ${{ steps.comment-branch.outputs.head_ref }} | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.issue.pull_request.head.ref }} | |
repository: ${{ github.event.issue.pull_request.head.repo.full_name }} | |
- name: Check if Github organization is set | |
run: | | |
if [ -n "${{ github.organization }}" ]; then | |
echo "organization=${{ github.organization }}" | |
else | |
echo "Github organization is not set" | |
fi | |
- name: Test step | |
run: echo "This is a test" | |
- name: get the pr number | |
run: echo "pr_number=${{ github.event.issue.number }}" | |
- name: Sleeping for 1min | |
run: sleep 60 | |
- name: adding an error | |
run: exit 1 | |
- name: Check Event JSON | |
run: echo "${{ toJson(github.event) }}" | |
- name: Sleeping for 1min | |
run: sleep 60 | |
- name: Set latest comit status as ${{ job.status }} | |
uses: myrotvorets/set-commit-status-action@master | |
if: always() | |
with: | |
sha: ${{ steps.comment-branch.outputs.head_sha }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
status: ${{ job.status }} | |