-
Notifications
You must be signed in to change notification settings - Fork 159
43 lines (39 loc) · 1.27 KB
/
dependabot-yarn-mirror.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
name: dependabot-yarn-mirror
on:
push:
branches: [ dependabot/**/* ]
pull_request:
branches: [ dependabot/**/* ]
concurrency:
group: dependabot-yarn-mirror-${{ github.ref }}
cancel-in-progress: true
jobs:
yarn-mirror:
if: github.repository == 'carbon-design-system/carbon-for-ibm-dotcom'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
token: ${{secrets.MERGE_ACTION || github.token}}
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'yarn'
- name: Get branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: get_branch
- name: Install dependencies
run: yarn install --no-immutable --immutable-cache
- name: Push changes
run: |
if [ -z "$(git status --porcelain)" ]; then
echo "Mirror is clean, exiting..."
else
git config --global user.email ${{ secrets.BOT_EMAIL }}
git config --global user.name ${{ secrets.BOT_NAME }}
git add -A
git commit -m "chore(yarn): update yarn offline mirror"
git push origin ${{ steps.get_branch.outputs.branch }}
fi