-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup Weekly Automation to Update @actions/github (#498)
* create automation to update Octokit for actions toolkit Co-authored-by: Dependency Update Bot <bot@github.com> Co-authored-by: Shohei Ueda <30958501+peaceiris@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3e40dd3
commit 8e14ff9
Showing
3 changed files
with
91 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "UpdateOctokit" | ||
|
||
on: | ||
schedule: | ||
- cron: '0 18 * * 0' # sunday at 18 UTC | ||
|
||
jobs: | ||
UpdateOctokit: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.repository_owner == 'actions' }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Update Octokit | ||
working-directory: packages/github | ||
run: | | ||
npx npm-check-updates -u --dep prod | ||
npm install | ||
- name: Check Status | ||
id: status | ||
working-directory: packages/github | ||
run: | | ||
if [[ "$(git status --porcelain)" != "" ]]; then | ||
echo "::set-output name=createPR::true" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
git checkout -b bots/updateGitHubDependencies-${{github.run_number}} | ||
git add . | ||
git commit -m "Update Dependencies" | ||
git push --set-upstream origin bots/updateGitHubDependencies-${{github.run_number}} | ||
fi | ||
- name: Create PR | ||
if: ${{steps.status.outputs.createPR}} | ||
uses: actions/github-script@v2 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
github.pulls.create( | ||
{ | ||
base: "master", | ||
owner: "${{github.repository_owner}}", | ||
repo: "toolkit", | ||
title: "Update Octokit dependencies", | ||
body: "Update Octokit dependencies", | ||
head: "bots/updateGitHubDependencies-${{github.run_number}}" | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters