-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 1.51 KB
/
main.yaml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Main
on:
workflow_dispatch:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Set extra GitHub environment variables
id: github-env-vars
uses: rlespinasse/github-slug-action@v4
- name: Checkout source
id: checkout-source
uses: actions/checkout@v4
- name: Schema Validation
id: schema-validation
uses: dsanders11/json-schema-validate-action@v1.2.0
with:
files: 'action.yaml'
schema: https://json.schemastore.org/github-action.json
merge:
needs:
- build
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Set extra GitHub environment variables
id: github-env-vars
uses: rlespinasse/github-slug-action@v4
- name: Checkout source
id: checkout-source
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Merge branch
id: merge-branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Configuring git"
git config user.name "GitHub Actions"
git config user.email "<>"
echo "Checking out branch"
git fetch origin v1
git checkout v1
git reset --hard v1
echo "Merging branch"
git merge --no-ff $GITHUB_REF
echo "Pushing branch"
git push origin v1