Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically update certificate data #32

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 21 additions & 23 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,34 @@ name: Update

on:
schedule:
# Every Monday at 10am
- cron: '0 10 * * 1'
workflow_dispatch:
- cron: '*/5 * * * *'

jobs:
update:
name: Update bundle
runs-on: ubuntu-latest

steps:
- uses: actions/setup-go@v2
if: github.repository == 'certifi/gocertifi'
with:
go-version: '1.16'
- uses: actions/setup-go@v2
if: github.repository == 'certifi/gocertifi'
with:
go-version: '1.16'

- uses: actions/checkout@v2
if: github.repository == 'certifi/gocertifi'
with:
ref: test-update
- uses: actions/checkout@v2
if: github.repository == 'certifi/gocertifi'

- name: Run go generate
if: github.repository == 'certifi/gocertifi'
run: go generate
- name: Run go generate
if: github.repository == 'certifi/gocertifi'
run: go generate

- name: Commit files
if: github.repository == 'certifi/gocertifi'
run: |
tag=$(date +%Y.%m.%d)
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add certifi.go
git commit -m "Update $tag"
git push
- name: Get current date
if: github.repository == 'certifi/gocertifi'
id: date
run: echo "::set-output name=date::$(date +'%Y.%m.%d')"

- uses: stefanzweifel/git-auto-commit-action@v4
if: github.repository == 'certifi/gocertifi'
with:
commit_message: "Update ${{ steps.date.outputs.date }}"
tagging_message: "${{ steps.date.outputs.date }}"
commit_author: "GitHub Actions <[email protected]>"