Skip to content

Commit

Permalink
Setup Weekly Automation to Update @actions/github (#498)
Browse files Browse the repository at this point in the history
* 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
4 people authored Jun 19, 2020
1 parent 3e40dd3 commit 8e14ff9
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 65 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/update-github.yaml
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}}"
})
102 changes: 41 additions & 61 deletions packages/github/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
"url": "https://github.com/actions/toolkit/issues"
},
"dependencies": {
"@actions/http-client": "^1.0.3",
"@octokit/core": "^2.5.1",
"@octokit/plugin-paginate-rest": "^2.2.0",
"@octokit/plugin-rest-endpoint-methods": "^3.10.0"
"@actions/http-client": "^1.0.8",
"@octokit/core": "^3.0.0",
"@octokit/plugin-paginate-rest": "^2.2.3",
"@octokit/plugin-rest-endpoint-methods": "^4.0.0"
},
"devDependencies": {
"jest": "^25.1.0",
Expand Down

0 comments on commit 8e14ff9

Please sign in to comment.