Skip to content

Commit

Permalink
☕ fix update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hasundue committed Nov 4, 2023
1 parent ea7370b commit 96d8cbf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update
name: update

on:
schedule:
Expand All @@ -18,19 +18,32 @@ jobs:
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
- name: Update dependencies and commit changes
run: deno task -q upgrade:commit --summary title.txt --report body.md
run: deno task -q upgrade:commit --summary ../title.txt --report ../body.md
- name: Check result
id: result
uses: andstor/file-existence-action@v2
with:
files: title.txt, body.md
- name: Push changes
files: ../title.txt, ../body.md
- name: Read title.txt
id: title
if: steps.result.outputs.files_exists == 'true'
run: git push -f origin HEAD:automation/update-dependencies
uses: juliangruber/read-file-action@v1
with:
path: ../title.txt
- name: Read body.md
id: body
if: steps.result.outputs.files_exists == 'true'
uses: juliangruber/read-file-action@v1
with:
path: ../body.md
- name: Create a pull request
if: steps.result.outputs.files_exists == 'true'
run: >
gh pr create --title "$(cat title.txt)" --body "$(cat body.md)"
--label "automation" --head "automation/update-dependencies"
env:
GITHUB_TOKEN: ${{ secrets.PA_TOKEN }}
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PA_TOKEN }}
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
branch: automation/update-dependencies
title: ${{ steps.title.outputs.content }}
body: ${{ steps.body.outputs.content }}
labels: automation
delete-branch: true
5 changes: 2 additions & 3 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"test": "deno test --unstable -A --parallel --shuffle --doc --coverage=.coverage",
"check": "deno check --unstable $(find . -name '*.ts')",
"coverage": "deno coverage --unstable .coverage",
"run:molt": "deno run -q -A https://deno.land/x/[email protected]/cli.ts",
"upgrade": "deno task -q run:molt check ./**/*.ts",
"upgrade:commit": "deno task -q run:molt update --commit --prefix :package: ./**/*.ts"
"upgrade": "deno run -q -A https://deno.land/x/[email protected]/cli.ts ./**/*.ts",
"upgrade:commit": "deno task -q upgrade --commit --prefix :package: --pre-commit=fmt"
}
}

0 comments on commit 96d8cbf

Please sign in to comment.