Skip to content

Commit

Permalink
Automate keeping the sfe-next branch upto date
Browse files Browse the repository at this point in the history
  • Loading branch information
dschep committed Sep 24, 2019
1 parent 113a1a1 commit f6dafb4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/update-sfe-next.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
args: git config --global user.email "[email protected]" && 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/[email protected]
with:
args: git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} HEAD:sfe-next -f
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions scripts/update-sfe-dep.js
Original file line number Diff line number Diff line change
@@ -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));

0 comments on commit f6dafb4

Please sign in to comment.