Skip to content

Commit

Permalink
Add PR opened workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JunTaoLuo committed Dec 7, 2023
1 parent c6b40db commit 91bc37e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/tugboat-pr-opened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Create Tugboat Preview
on:
pull_request:
types:
- opened

jobs:
tugboat_create_preview:
runs-on: self-hosted
name: Create a Tugboat Preview
steps:
- name: Create Tugboat Preview
id: tugboat_pr_preview
run: |
curl -H "Authorization: Bearer ${{ secrets.TUGBOAT_API_TOKEN }}" \
-H "Content-Type: application/json" \
-X POST \
-d '{ "repo": "${{ secrets.TUGBOAT_REPOSITORY }}", "ref": "${{ github.event.pull_request.number }}", "name": "${{ github.event.pull_request.title }}", "type": "pullrequest" }' \
-o .tugboat_response.json
https://api.tugboat.vfs.va.gov/v3/previews
- name: Diagnostics
run: cat tugboat_response.json
- name: Extract Preview ID
run: jq -r .preview .tugboat_response.json > .tugboat_preview.txt
- name: Save Preview ID
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: .tugboat_preview.txt
key: ${{ runner.os }}-tugboat-preview-id-pr-${{ github.event.pull_request.number }}

0 comments on commit 91bc37e

Please sign in to comment.