-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (52 loc) · 2.19 KB
/
update_package_version_main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Update package version [main]
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize]
workflow_dispatch:
repository_dispatch:
types: [update_package_version_main]
concurrency:
group: sync_update_package_version_main
cancel-in-progress: true
jobs:
bump-version: # https://github.com/maks-stupak/gh-action-bump-version/blob/master/.github/workflows/push.yml
name: Bump Version on main branch
runs-on: ubuntu-20.04
steps:
- name: "Partially checkout source code"
# Fast checkout of package.json in order to bump the version number.
run: |
REPO="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
git config --global user.email [email protected]
git config --global user.name github-actions
git clone --filter=blob:none --no-checkout --depth 1 --sparse $REPO .
git sparse-checkout init --cone
git sparse-checkout add "package.json"
git checkout
- name: "cat package.json"
# Recommended by phips28/gh-action-bump-version (required)
run: cat ./package.json
- name: "Automated Version Bump"
continue-on-error: true
# https://github.com/phips28/gh-action-bump-version
# Method suggestion from https://github.com/maks-stupak/gh-action-bump-version/blob/master/.github/workflows/push.yml
# Bump the version number of this content package repo.
uses: "phips28/[email protected]"
with:
tag-prefix: ''
commit-message: 'Bumps main branch content package version to {{version}}.'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "cat package.json"
# Recommended by phips28/gh-action-bump-version (required)
run: cat ./package.json
- name: Repository dispatch to cagov/cannabis.ca.gov [main]
# description: "Send signal to static site generation repo to trigger an update."
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.ODI_GITHUB_TOKEN }}
repository: cagov/cannabis.ca.gov
event-type: static_content_update_main