Skip to content

A local-first personal finance app

Run “Handle completed feature requests” in pull_request_target (#1243)

Jed Foxf4940dceb157
diff --git a/.github/actions/handle-feature-requests.js b/.github/actions/handle-feature-requests.js
index 4bcce0e129..4c7b291972 100644
--- a/.github/actions/handle-feature-requests.js
+++ b/.github/actions/handle-feature-requests.js
@@ -73,7 +73,10 @@ async function main() {
await group(`Issue #${number}: Remove labels`, async () => {
const toRemove = labels.nodes
.filter(
- label => label.name === 'help wanted' || label.name === 'needs votes',
+ label =>
+ label.name === 'help wanted' ||
+ label.name === 'needs votes' ||
+ lahel.name === 'good first issue',
)
.map(label => label.id);
const res = await makeAPIRequest(
diff --git a/.github/workflows/issues-feature-implemented.yml b/.github/workflows/issues-feature-implemented.yml
index 43012f5226..039ee5e500 100644
--- a/.github/workflows/issues-feature-implemented.yml
+++ b/.github/workflows/issues-feature-implemented.yml
@@ -1,9 +1,20 @@
name: Handle completed feature requests
+##########################################################################################
+# WARNING! This workflow uses the 'pull_request_target' event. That mans that it will #
+# always run in the context of the main actualbudget/actual repo, even if the PR is from #
+# a fork. This is necessary to get access to a GitHub token that can post a comment on #
+# the PR. Be VERY CAREFUL about adding things to this workflow, since forks can inject #
+# arbitrary code into their branch, and can pollute the artifacts we download. Arbitrary #
+# code execution in this workflow could lead to a compromise of the main repo. #
+##########################################################################################
+# See: https://securitylab.github.com/research/github-actions-preventing-pwn-requests #
+##########################################################################################
+
on:
- pull_request:
+ pull_request_target:
types: [closed]
-
+
permissions:
issues: write
@@ -12,6 +23,7 @@ jobs:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
+ # This is not a security concern because we have approved & merged the PR
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
diff --git a/upcoming-release-notes/1243.md b/upcoming-release-notes/1243.md
new file mode 100644
index 0000000000..4c36207201
--- /dev/null
+++ b/upcoming-release-notes/1243.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [j-f1]
+---
+
+Fix workflow that posts auto comments on implemented feature requests