-
Notifications
You must be signed in to change notification settings - Fork 41
48 lines (46 loc) · 1.56 KB
/
update_twofactorauth.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
name: "🕒 Synchronize Two-factor auth"
on:
workflow_dispatch:
push:
branches:
- master
paths:
# Configuration.
- '.github/update_twofactorauth.py'
schedule:
- cron: '0 0 * * 5'
jobs:
sync-2fa:
name: Synchronize Two-factor authentication
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Update library"
run: |
python .github/update_twofactorauth.py
- name: "Check if any changes"
id: check-changes
run: |
has_changes=$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi)
echo "$has_changes"
echo "{HAS_CHANGES}={$has_changes}" >> "$GITHUB_OUTPUT"
- name: Commit and push changes
uses: devops-infra/action-commit-push@v0.9.2
if: ${{ startsWith(steps.check-changes.outputs.HAS_CHANGES, 'true') }}
with:
github_token: "${{ secrets.PERSONAL_TOKEN }}"
add_timestamp: false
commit_prefix: "[AUTO]"
commit_message: "Update two-factor auth library"
force: true
target_branch: tfa_2factorauth_action
- name: Create pull request
uses: devops-infra/action-pull-request@v0.5.5
if: ${{ startsWith(steps.check-changes.outputs.HAS_CHANGES, 'true') }}
with:
github_token: "${{ secrets.PERSONAL_TOKEN }}"
source_branch: tfa_2factorauth_action
target_branch: master
assignee: AChep
label: "robot,enhancement"
title: New Two-factor auth by GitHub Action