Skip to content

Commit

Permalink
ci: update actions through dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioramos committed Aug 25, 2020
1 parent ba1620d commit d416f23
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 26 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: 'npm'
directory: '/'
schedule:
Expand Down
37 changes: 22 additions & 15 deletions .github/workflows/on-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,47 @@ name: Continuous Updates

on:
push:
branches: [ dependabot/** ]
branches: [ dependabot/npm_and_yarn/** ]
pull_request:
types: [opened, synchronize, reopened]
branches: [ dependabot/** ]
branches: [ dependabot/npm_and_yarn/** ]

jobs:
build:
update-manifests:
runs-on: ubuntu-latest
steps:
- uses: technote-space/auto-cancel-redundant-job@v1
- uses: actions/checkout@v2
with:
fetch-depth: 20
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2.1.1
with:
node-version: '14.x'
- name: Autofix lockfile
- name: Config Git
run: |
git config --global user.name '${{ github.event.commits[0].author.name }}'
git config --global user.email '${{ github.event.commits[0].author.email }}'
- name: Fix yarn.lock
run: |
# get current branch
echo ::set-env name=GITHUB_REF_SLUG::"$(git branch --show-current)"
# revert changes to yarn.lock
git checkout ${{ github.sha }}^ -- yarn.lock
# IF only yarn.lock changed, update package.json too
git diff --name-only HEAD^ HEAD | grep -q 'package.json' || yarn up `git log -1 --pretty=%s | awk '{ print $3 }'`
# regardless, run yarn to update yarn.lock
yarn
# stage package.json and yarn.lock
git add yarn.lock package.json
# commit changes
git commit --amend --no-edit --allow-empty -n
env:
YARN_CHECKSUM_BEHAVIOR: update
YARN_ENABLE_SCRIPTS: 0
- name: Config Git
run: |
git config --global user.name '${{ github.event.commits[0].author.name }}'
git config --global user.email '${{ github.event.commits[0].author.email }}'
- name: Commit changes
run: |
git add yarn.lock
git commit --amend --no-edit -n
- name: Get branch
uses: rlespinasse/github-slug-action@2.0.0
- name: Test
run: yarn run test
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2.1.1
with:
node-version: '13.x'
- name: Setup Cache
uses: actions/cache@v1
uses: actions/cache@v2.1.1
with:
path: .yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
Expand All @@ -35,7 +35,7 @@ jobs:
with:
fetch-depth: 0
- name: Commit Lint
uses: wagoid/commitlint-github-action@v1
uses: wagoid/commitlint-github-action@v2.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -49,11 +49,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2.1.1
with:
node-version: '13.x'
- name: Setup Cache
uses: actions/cache@v1
uses: actions/cache@v2.1.1
with:
path: .yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
Expand All @@ -72,11 +72,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2.1.1
with:
node-version: '13.x'
- name: Setup Cache
uses: actions/cache@v1
uses: actions/cache@v2.1.1
with:
path: .yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
Expand All @@ -95,11 +95,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2.1.1
with:
node-version: '13.x'
- name: Setup Cache
uses: actions/cache@v1
uses: actions/cache@v2.1.1
with:
path: .yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
Expand All @@ -108,7 +108,7 @@ jobs:
- name: Benchmark
run: yarn run benchmark
- name: Get branch
uses: rlespinasse/github-slug-action@1.1.0
uses: rlespinasse/github-slug-action@2.1.0
- name: Release
uses: ridedott/release-me-action@master
if: ${{ env.GITHUB_REF_SLUG == 'master' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2.1.1
- name: Install dependencies
run: yarn install --immutable
env:
Expand Down

0 comments on commit d416f23

Please sign in to comment.