Skip to content

Commit 489c3e3

Browse files
authored
update workflow
1 parent 28a2f43 commit 489c3e3

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

.github/helper/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"gh-helpers": "^1.0.0"
4+
}
5+
}

.github/helper/updator.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,16 @@ async function main () {
6262
exec('git config user.email "41898282+github-actions[bot]@users.noreply.github.com"')
6363
exec('git add --all')
6464
exec(`git commit -m "Update to version ${newVersion}"`)
65-
exec(`git push origin ${branchName}`)
65+
exec(`git push origin ${branchName} --force`)
6666
// createPullRequest(title: string, body: string, fromBranch: string, intoBranch?: string): Promise<{ number: number, url: string }>;
6767
const pr = await github.createPullRequest(
68-
`${newVersion} updates`,
69-
`Automatically generated PR for Minecraft version ${newVersion}.\n\nRef: ${mcdataPrURL}`,
68+
`🎈 ${newVersion}`,
69+
`This automated PR sets up the relevant boilerplate for Minecraft version ${newVersion}.
70+
71+
Related: ${mcDataPrURL}
72+
73+
* You can help contribute to this PR by opening a PR against this <code branch>${branchName}</code> branch instead of <code>master</code>.
74+
`,
7075
branchName,
7176
'master'
7277
)

.github/workflows/update-from-minecraft-data.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ jobs:
2727
with:
2828
token: ${{ secrets.PAT_PASSWORD }}
2929

30-
- name: Install dependencies
31-
run: npm install gh-helpers
32-
3330
- name: Run updator script
34-
run: node .github/helper/updator.js
31+
run: cd .github/helper && npm install && node updator.js
3532
env:
3633
GITHUB_TOKEN: ${{ secrets.PAT_PASSWORD }}
3734
MCDATA_BRANCH: ${{ github.event.inputs.mcdata_branch }}

0 commit comments

Comments
 (0)