Skip to content

Commit a3f395a

Browse files
committed
make commits+PRs for new deployments more descriptive
It can be difficult to track down what PR corresponds to what issue if the titles/descriptions are just boilerplate like "[Config ##] create new file" We can export the abbreviated name of the deployment from issue-to-json.js and include that in the titles alongside the issue #, both in the commit and PR descriptions
1 parent 124622b commit a3f395a

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

.github/actions/convertIssue/issue-to-json.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ export async function issueToJson() {
4242

4343
let abbrevKey = getInput("hash-property-name");
4444
abbrevKey = abbrevKey.toLowerCase();
45-
let fileName = getFileName(configData[ abbrevKey ]);
46-
await writeFile(path.join(outputDir, fileName), JSON.stringify(configData, null, 4));
45+
let abbrev = configData[abbrevKey];
46+
exportVariable("UrlAbbreviation", abbrev);
47+
let fileName = getFileName(abbrev);
48+
await writeFile(
49+
path.join(outputDir, fileName),
50+
JSON.stringify(configData, null, 4) + "\n",
51+
);
4752
} catch (error) {
4853
setFailed(error.message);
4954
}

.github/workflows/issue-to-json.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,17 @@ jobs:
3838
git config --local user.email "action@github.com"
3939
git config --local user.name "GitHub Action"
4040
git add configs/
41-
git commit -m "Creating or updating file from form in issue #${{ env.IssueNumber }}"
41+
git commit \
42+
-m "[${{ env.UrlAbbreviation }}] generate config from #${{ github.event.issue.number }}" \
43+
-m "- Triggered by creating or updating issue #${{ github.event.issue.number }}"
44+
-m "- Auto-generated by the \`convert-issue-to-json\` workflow
45+
4246
- name: Create Pull Request
43-
id: cpr
4447
uses: peter-evans/create-pull-request@v5
4548
with:
46-
add-paths: |
47-
configs/
48-
commit-message: Create or update a new config file
49-
signoff: false
50-
branch: new-config-#${{ env.IssueNumber }}
51-
delete-branch: false
52-
title: '[Config #${{ env.IssueNumber }}] create new file'
49+
add-paths: configs/
50+
branch: new-config-#${{ github.event.issue.number }}
51+
title: '[${{ env.UrlAbbreviation }}] generate config from #${{ github.event.issue.number }}'
5352
body: |
54-
Adding a new config file
55-
- Initialized by creating or updating the coressponding issue
56-
- Auto-generated by [create-pull-request][1]
57-
58-
[1]: https://github.com/peter-evans/create-pull-request
59-
draft: false
53+
- Triggered by creating or updating issue #${{ github.event.issue.number }}
54+
- Auto-generated by the \`convert-issue-to-json\` workflow

0 commit comments

Comments
 (0)