Skip to content

Commit

Permalink
fix: correctly substitute testing instructions in issue template (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsgruk authored May 30, 2024
1 parent 0b94fba commit a8f0293
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions call-for-testing/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ inputs:
description: "Custom instructions for testing the `candidate` snap"
default: |
1. Stop the application if it was already running
1. Upgrade to this version by running
2. Upgrade to this version by running
```shell
snap refresh {{ env.snap_name }} --channel {{ env.channel }}
```
1. Start the app and test it out.
1. Finally, add a comment below explaining whether this app is working, and **include the output of the following command**.
3. Start the app and test it out.
4. Finally, add a comment below explaining whether this app is working, and **include the output of the following command**.
```shell
snap version; lscpu | grep Architecture; snap info {{ env.snap_name }} | grep installed
Expand Down Expand Up @@ -127,10 +127,14 @@ runs:
echo "revisions=${joined%,}" >> "$GITHUB_OUTPUT"
echo "table=${table}" >> "$GITHUB_OUTPUT"
- name: Fetch the call for testing template
- name: Prepare the call for testing template
shell: bash
run: |
wget -qO template.md "https://raw.githubusercontent.com/${{ inputs.ci-repo }}/main/call-for-testing/template.md"
# Fetch the template from the repo
wget -qO template-raw.md "https://raw.githubusercontent.com/${{ inputs.ci-repo }}/main/call-for-testing/template.md"
# Substitute in the testing instructions
awk -v r="${{ inputs.testing-instructions }}" '{gsub(/TESTING_INSTRUCTIONS/,r)}1' template-raw.md > template.md
- name: Create call for testing issue
uses: JasonEtco/create-an-issue@v2
Expand All @@ -143,6 +147,5 @@ runs:
table: ${{ steps.build.outputs.table }}
version: ${{ steps.snapcraft-yaml.outputs.version }}
promotion_channel: ${{ inputs.promotion-channel }}
testing_instructions: ${{ inputs.testing-instructions }}
with:
filename: ./template.md
2 changes: 1 addition & 1 deletion call-for-testing/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If configured, the snap will be installed in a VM, and any test results or scree

## How to test it manually

{{env.testing_instructions}}
TESTING_INSTRUCTIONS

## How to release it

Expand Down

0 comments on commit a8f0293

Please sign in to comment.