2020-06-19 18:35:19 +00:00
|
|
|
name: "UpdateOctokit"
|
|
|
|
|
|
|
|
on:
|
2021-04-02 16:08:46 +00:00
|
|
|
workflow_dispatch:
|
2020-06-19 18:35:19 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
UpdateOctokit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ github.repository_owner == 'actions' }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-11-04 11:23:24 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-06-19 18:35:19 +00:00
|
|
|
- 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"
|
2020-07-14 20:46:07 +00:00
|
|
|
git config --global user.email "github-actions@github.com"
|
2020-06-19 18:35:19 +00:00
|
|
|
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(
|
|
|
|
{
|
2020-07-21 15:33:05 +00:00
|
|
|
base: "main",
|
2020-06-19 18:35:19 +00:00
|
|
|
owner: "${{github.repository_owner}}",
|
|
|
|
repo: "toolkit",
|
|
|
|
title: "Update Octokit dependencies",
|
|
|
|
body: "Update Octokit dependencies",
|
|
|
|
head: "bots/updateGitHubDependencies-${{github.run_number}}"
|
|
|
|
})
|