From f6dafb4e9aba780a6614a67ffe098f982182a7e0 Mon Sep 17 00:00:00 2001 From: Daniel Schep Date: Tue, 24 Sep 2019 14:22:05 -0400 Subject: [PATCH] Automate keeping the sfe-next branch upto date --- .github/workflows/update-sfe-next.yml | 25 +++++++++++++++++++++++++ scripts/update-sfe-dep.js | 7 +++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/update-sfe-next.yml create mode 100644 scripts/update-sfe-dep.js diff --git a/.github/workflows/update-sfe-next.yml b/.github/workflows/update-sfe-next.yml new file mode 100644 index 000000000..6ea91b133 --- /dev/null +++ b/.github/workflows/update-sfe-next.yml @@ -0,0 +1,25 @@ +on: + push: + # Sequence of patterns matched against refs/heads + branches: + - master +name: Update the sfe-next branch on pushes to master +jobs: + updateSfeNextBranch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Setup node + uses: actions/setup-node@v1 + - name: update the dependency on @serverless/enterprise-plugin to the next tag + run: node scripts/update-sfe-dep.js + - name: git commit + uses: srt32/git-actions@v0.0.3 + with: + args: git config --global user.email "engineering@serverless.com" && git config --global user.name "Github Action" && git commit -am 'update the dependency on @serverless/enterprise-plugin to the next tag' + - name: git push + uses: srt32/git-actions@v0.0.3 + with: + args: git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} HEAD:sfe-next -f + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/update-sfe-dep.js b/scripts/update-sfe-dep.js new file mode 100644 index 000000000..01ccd67e9 --- /dev/null +++ b/scripts/update-sfe-dep.js @@ -0,0 +1,7 @@ +const fs = require('fs'); + +const pkgJson = JSON.parse(fs.readFileSync('package.json')); + +pkgJson.dependencies['@serverless/enterprise-plugin'] = 'next'; + +fs.writeFileSync('package.json', JSON.stringify(pkgJson, null, 2));