Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly substitute testing instructions in issue template #42

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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