Skip to content

Commit

Permalink
add input for github_token secret
Browse files Browse the repository at this point in the history
  • Loading branch information
whummer committed Sep 23, 2023
1 parent c23125d commit c2b5f99
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 33 deletions.
47 changes: 26 additions & 21 deletions finish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,35 @@ on:
types:
- completed

jobs:
success:
runs-on: ubuntu-latest
inputs:
github_token:
description: 'Github token used to create PR comments'
required: true

runs:
using: composite
steps:
# if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
steps:
- name: Download PR artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: pr
- name: Download PR artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: pr

- name: Load the PR ID
id: pr
run: echo "pr_id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
- name: Load the PR ID
id: pr
shell: bash
run: echo "pr_id=$(<pr-id.txt)" >> $GITHUB_OUTPUT

- name: Update status comment
uses: actions-cool/maintain-one-comment@v3.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
🚀 LocalStack Stack Insights and Cloud Pod state for this CI run: https://app.localstack.cloud/ci
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.pr_id }}
- name: Update status comment
uses: actions-cool/maintain-one-comment@v3.1.1
with:
token: ${{ inputs.github_token }}
body: |
🚀 LocalStack Stack Insights and Cloud Pod state for this CI run: https://app.localstack.cloud/ci
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.pr_id }}

# failed:
# runs-on: ubuntu-latest
Expand Down
28 changes: 16 additions & 12 deletions prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@ name: Start CI Build

on: pull_request_target

jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Create initial PR comment
uses: actions-cool/maintain-one-comment@v3.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
⚡️ Running CI build with LocalStack ...
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
inputs:
github_token:
description: 'Github token used to create PR comments'
required: true

runs:
using: composite
steps:
- name: Create initial PR comment
uses: actions-cool/maintain-one-comment@v3.1.1
with:
token: ${{ inputs.github_token }}
body: |
⚡️ Running CI build with LocalStack ...
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'

0 comments on commit c2b5f99

Please sign in to comment.