From 02ed47c5782bffb82bf65f37532fb7dea8cc45a4 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 13 Jan 2024 07:36:09 +0100 Subject: [PATCH 1/8] Update job. Do it manually. --- .github/workflows/debug-info-actions.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/debug-info-actions.yml b/.github/workflows/debug-info-actions.yml index 3ff1991198..e66f3eb98c 100644 --- a/.github/workflows/debug-info-actions.yml +++ b/.github/workflows/debug-info-actions.yml @@ -14,14 +14,18 @@ permissions: checks: read jobs: - demo: + respond: runs-on: ubuntu-latest steps: - uses: github/command@v1.1.0 id: command with: command: ".eOxNZAmyGz6CXMyf" - - run: gh issue edit "$NUMBER" --add-label "$LABELS" + - run: | + ISSUE_BODY=$(gh issue view 8380 --json body) + if [[ $string == *".eOxNZAmyGz6CXMyf"* ]]; then + gh issue edit "$NUMBER" --add-label "$LABELS" + fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} From 9f71cf966cfe8e4ab7795d92e38d4dedb697bf23 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 13 Jan 2024 07:36:55 +0100 Subject: [PATCH 2/8] Remove the old step. --- .github/workflows/debug-info-actions.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/debug-info-actions.yml b/.github/workflows/debug-info-actions.yml index e66f3eb98c..307ce74162 100644 --- a/.github/workflows/debug-info-actions.yml +++ b/.github/workflows/debug-info-actions.yml @@ -17,10 +17,6 @@ jobs: respond: runs-on: ubuntu-latest steps: - - uses: github/command@v1.1.0 - id: command - with: - command: ".eOxNZAmyGz6CXMyf" - run: | ISSUE_BODY=$(gh issue view 8380 --json body) if [[ $string == *".eOxNZAmyGz6CXMyf"* ]]; then From 908539836b73eae8eef7d6b84dfec08428849106 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 13 Jan 2024 07:38:21 +0100 Subject: [PATCH 3/8] Use correct string name. --- .github/workflows/debug-info-actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/debug-info-actions.yml b/.github/workflows/debug-info-actions.yml index 307ce74162..545ad8fc7b 100644 --- a/.github/workflows/debug-info-actions.yml +++ b/.github/workflows/debug-info-actions.yml @@ -1,4 +1,4 @@ -name: 'Issues - respond to hidden commands' +name: 'Issues - Respond to hidden commands' # the workflow to execute on is comments that are newly created on: @@ -19,7 +19,7 @@ jobs: steps: - run: | ISSUE_BODY=$(gh issue view 8380 --json body) - if [[ $string == *".eOxNZAmyGz6CXMyf"* ]]; then + if [[ $ISSUE_BODY == *".eOxNZAmyGz6CXMyf"* ]]; then gh issue edit "$NUMBER" --add-label "$LABELS" fi env: From 8c7ab50325884d61416454be643d234a7742aad8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 13 Jan 2024 07:40:01 +0100 Subject: [PATCH 4/8] Add the action manually. --- .github/workflows/debug-info-actions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/debug-info-actions.yml b/.github/workflows/debug-info-actions.yml index 545ad8fc7b..c97bcc0c4d 100644 --- a/.github/workflows/debug-info-actions.yml +++ b/.github/workflows/debug-info-actions.yml @@ -27,3 +27,4 @@ jobs: GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.issue.number }} LABELS: v2-layout-issue + - uses: dessant/label-actions@v4 From 4605d84cc8d49e027e4135217e7d06f8ec431cc4 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 13 Jan 2024 07:41:15 +0100 Subject: [PATCH 5/8] Add more permissions --- .github/workflows/debug-info-actions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/debug-info-actions.yml b/.github/workflows/debug-info-actions.yml index c97bcc0c4d..3289f704f6 100644 --- a/.github/workflows/debug-info-actions.yml +++ b/.github/workflows/debug-info-actions.yml @@ -9,6 +9,7 @@ on: # permissions needed for reacting to IssueOps commands on issues and PRs permissions: + contents: read pull-requests: write issues: write checks: read From ccc851090a03e201b690d540bc1b40bbf8d5eb9b Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 13 Jan 2024 07:50:43 +0100 Subject: [PATCH 6/8] Manually add comment, lock and redirect user. --- .github/workflows/debug-info-actions.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/debug-info-actions.yml b/.github/workflows/debug-info-actions.yml index 3289f704f6..ea3cae7f04 100644 --- a/.github/workflows/debug-info-actions.yml +++ b/.github/workflows/debug-info-actions.yml @@ -19,9 +19,24 @@ jobs: runs-on: ubuntu-latest steps: - run: | - ISSUE_BODY=$(gh issue view 8380 --json body) + ISSUE_BODY=$(gh issue view $NUMBER --json body) if [[ $ISSUE_BODY == *".eOxNZAmyGz6CXMyf"* ]]; then - gh issue edit "$NUMBER" --add-label "$LABELS" + # comment on issue + read -r -d '' REPLY << EOF + Hi there! This is an automatic reply. `Share and enjoy` + + It seems your issue is about the new v2-layout that is currently in development for Firefly III. + + These issues are collected in [a GitHub discussion](https://github.com/firefly-iii/firefly-iii/issues/8361). + + Please note that the v2 layout is still very much in development. + + Thank you for your contributions. + EOF + + gh issue comment "$NUMBER" --body "$REPLY" + gh issue close "$NUMBER" --reason completed + gh issue lock "$NUMBER" fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 50f346d092c3f620d996626fc14911d4153a660d Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 13 Jan 2024 07:54:12 +0100 Subject: [PATCH 7/8] Add body to secret --- .github/workflows/debug-info-actions.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/debug-info-actions.yml b/.github/workflows/debug-info-actions.yml index ea3cae7f04..753b6dd548 100644 --- a/.github/workflows/debug-info-actions.yml +++ b/.github/workflows/debug-info-actions.yml @@ -21,20 +21,7 @@ jobs: - run: | ISSUE_BODY=$(gh issue view $NUMBER --json body) if [[ $ISSUE_BODY == *".eOxNZAmyGz6CXMyf"* ]]; then - # comment on issue - read -r -d '' REPLY << EOF - Hi there! This is an automatic reply. `Share and enjoy` - - It seems your issue is about the new v2-layout that is currently in development for Firefly III. - - These issues are collected in [a GitHub discussion](https://github.com/firefly-iii/firefly-iii/issues/8361). - - Please note that the v2 layout is still very much in development. - - Thank you for your contributions. - EOF - - gh issue comment "$NUMBER" --body "$REPLY" + gh issue comment "$NUMBER" --body "$V2_ISSUE_REPLY_BODY" gh issue close "$NUMBER" --reason completed gh issue lock "$NUMBER" fi @@ -42,5 +29,6 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.issue.number }} + V2_ISSUE_REPLY_BODY: ${{ secrets.V2_ISSUE_REPLY_BODY }} LABELS: v2-layout-issue - uses: dessant/label-actions@v4 From 1780e6dc613d85b5c442bc497256f4d70e3f04cb Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 13 Jan 2024 07:55:04 +0100 Subject: [PATCH 8/8] Remove label step, no longer necessary. --- .github/workflows/debug-info-actions.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/debug-info-actions.yml b/.github/workflows/debug-info-actions.yml index 753b6dd548..90ff6bffa2 100644 --- a/.github/workflows/debug-info-actions.yml +++ b/.github/workflows/debug-info-actions.yml @@ -31,4 +31,3 @@ jobs: NUMBER: ${{ github.event.issue.number }} V2_ISSUE_REPLY_BODY: ${{ secrets.V2_ISSUE_REPLY_BODY }} LABELS: v2-layout-issue - - uses: dessant/label-actions@v4