-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from movementlabsxyz/l-monninger/infra-integra…
…tion fix: testing workflow.
- Loading branch information
Showing
2 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
19 changes: 15 additions & 4 deletions
19
.github/workflows/infra.yml → .github/workflows/handle-target-comment.yml
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Comment Trigger Workflow | ||
|
||
on: | ||
issue_comment: | ||
types: [created, edited] | ||
|
||
jobs: | ||
dispatch-workflow: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if comment is on a PR | ||
id: check_pr | ||
run: | | ||
if [ "${{ github.event.issue.pull_request }}" == "" ]; then | ||
echo "This comment is not on a pull request." | ||
echo "::set-output name=is_pr::false" | ||
else | ||
echo "PR URL: ${{ github.event.issue.pull_request.url }}" | ||
echo "::set-output name=is_pr::true" | ||
- name: Fetch PR Details | ||
if: steps.check_pr.outputs.is_pr == 'true' | ||
id: get_pr | ||
uses: octokit/request-action@v2.x | ||
with: | ||
route: GET ${{ github.event.issue.pull_request.url }} | ||
mediaType: '{"previews": ["shadow-cat"]}' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Dispatch Target Workflow | ||
if: steps.check_pr.outputs.is_pr == 'true' | ||
uses: benc-uk/workflow-dispatch@v1 | ||
with: | ||
workflow: Triggered by Comment | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
inputs: '{"comment": "${{ github.event.comment.body }}"}' | ||
ref: ${{ fromJson(steps.get_pr.outputs.data).head.ref }} | ||
repo: ${{ fromJson(steps.get_pr.outputs.data).head.repo.full_name }} |