Skip to content

Commit

Permalink
Merge pull request #7 from mwangggg/gh_pr
Browse files Browse the repository at this point in the history
build_test
  • Loading branch information
mwangggg authored Jul 26, 2023
2 parents bff37a1 + 815fe3b commit da25732
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/pr-command.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: PR Command

concurrency:
group: ci-${{ github.run_id }}
cancel-in-progress: true

on:
issue_comment:
types: [created]

jobs:
build-and-test:
runs-on: ubuntu-latest
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/build_test') }}
steps:
- name: Set latest commit status as pending
uses: myrotvorets/set-commit-status-action@master
with:
sha: ${{ steps.comment-branch.outputs.head_sha }}
token: ${{ secrets.GITHUB_TOKEN }}
status: pending
- name: Command handler for building and testing
id: command
uses: xt0rted/slash-command-action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
command: build_test
reaction: "true"
reaction-type: "+1"
allow-edits: "false"
permission-level: write
- name: Build image
id: build-image
uses: ./.github/workflows/ci-build-image.yml
secrets: inherit
with:
build-arch: amd64
- name: Print the image
uses: thollander/actions-comment-pull-request@v1
with:
message: |-
Preview image available:
- name: Set latest commit status as ${{ job.status }}
uses: myrotvorets/set-commit-status-action@master
with:
sha: ${{ steps.comment-branch.outputs.head_sha }}
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}

0 comments on commit da25732

Please sign in to comment.