Skip to content

Commit

Permalink
feat: use filtered action for comment feedback on PRs that need chang…
Browse files Browse the repository at this point in the history
…esets

Signed-off-by: Lachlan Heywood <[email protected]>
  • Loading branch information
lachieh committed Jan 15, 2025
1 parent f7ac55f commit b4ef09b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/automate_changeset-feedback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Automate - Changeset Feedback

on:
pull_request_target:
branches:
- main

permissions:
pull-requests: write
contents: none

jobs:
feedback:
# Prevent running on forks
if: github.repository == 'wasmCloud/typescript'
runs-on: ubuntu-latest
steps:
# Comparing target commit ref to base ref means minimal history is needed for comparison
- name: Checkout PR
# Fetch the PR commit
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: 'refs/pull/${{ github.event.pull_request.number }}/merge'

- name: Fetch Base ref
# Fetch the base ref
run: git fetch --depth 1 origin ${{ github.base_ref }}

# Feedback is applied only to PR's that actually change code that would be part of a release
- name: Generate feedback
uses: backstage/actions/changeset-feedback@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17
with:
diff-ref: origin/main
issue-number: ${{ github.event.pull_request.number }}
bot-username: wasmcloud-automation-app[bot]
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_APP_PRIVATE_KEY }}
installation-id: ${{ secrets.BOT_APP_INSTALLATION_ID }}
4 changes: 2 additions & 2 deletions .github/workflows/sync_dependabot-changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ jobs:
const { stdout: commitMessage } = await exec.getExecOutput('git show --pretty=format:%s -s HEAD');
await createChangeset(fileName, commitMessage, packageNames);
await exec.exec('git', ['add', fileName]);
await exec.exec('git commit -C HEAD --amend --no-edit');
await exec.exec('git push --force');
await exec.exec('git commit -C HEAD --amend --no-edit --signoff');
await exec.exec('git push --force-with-lease --force-if-includes');

0 comments on commit b4ef09b

Please sign in to comment.