-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (35 loc) · 985 Bytes
/
build-number.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
name: Build Number
on:
workflow_call:
outputs:
build-number:
description: "The build number generated from git tags on current SHA."
value: ${{ jobs.build.outputs.build-number }}
inputs:
token:
description: 'GitHub token or PAT token'
required: false
default: ${{ github.token }}
type: string
#concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
build-number: ${{ steps.build-number.outputs.BUILD_NUMBER }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Generate build number
id: build-number
env:
INPUT_GITHUB_TOKEN: ${{ inputs.token }}
INPUT_SHA: ${{ github.event.pull_request.head.sha || github.event.workflow_run.head_sha }}
run: |
./scripts/build-number.sh