-
Notifications
You must be signed in to change notification settings - Fork 13
34 lines (34 loc) · 1.53 KB
/
Copy pathautoversion_main.yml
File metadata and controls
34 lines (34 loc) · 1.53 KB
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
name: Autoversion Main
on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *'
pull_request:
types: [ closed ]
jobs:
bump:
if: ${{ !github.event.repository.fork }}
runs-on: ubuntu-latest
permissions:
contents: none
actions: read
steps:
- uses: plengauer/opentelemetry-github/actions/instrument/job@v5.37.1
with:
secrets_to_redact: '["${{ github.token }}","${{ secrets.ACTIONS_GITHUB_TOKEN }}","${{ secrets.OPENAI_TOKEN }}"]'
env:
OTEL_EXPORTER_OTLP_ENDPOINT: '${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }}'
OTEL_EXPORTER_OTLP_HEADERS: '${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }}'
- id: should-autoversion
run: |
case "$GITHUB_EVENT_NAME" in
pull_request) cat "$GITHUB_EVENT_PATH" | jq .pull_request.base.ref -r | grep -q '^main$' && cat "$GITHUB_EVENT_PATH" | jq .pull_request.number -r | xargs -I '{}' curl ${GITHUB_API_URL:-https://api.github.com}/repos/"$GITHUB_REPOSITORY"/issues/'{}'/comments'?per_page=100' | jq '.[] | select(.body == "!release") | .author_association' -r | grep -q OWNER && echo true || echo false;;
*) echo true;;
esac | xargs -I '{}' echo result='{}' >> "$GITHUB_OUTPUT"
- uses: plengauer/autoversion@v2.2.0
if: ${{ steps.should-autoversion.outputs.result == 'true' }}
with:
github_token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
openai_token: ${{ secrets.OPENAI_TOKEN }}
path_include: ./meta:./src:./actions
increment_threshold: minor