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

UHF-10248: Use scoped token to trigger create pull request action #270

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions .github/workflows/update-config.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Check if required secrets are set
env:
AUTOMATIC_UPDATE_TOKEN: ${{ secrets.AUTOMATIC_UPDATE_TOKEN }}
if: env.AUTOMATIC_UPDATE_TOKEN == ''
run: exit 1

- name: Download latest dump
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -77,6 +83,7 @@ jobs:
uses: peter-evans/create-pull-request@v6
with:
commit-message: Update configuration
token: ${{ secrets.AUTOMATIC_UPDATE_TOKEN }}
title: Automatic update
labels: auto-update
body: |
Expand Down
10 changes: 8 additions & 2 deletions documentation/automatic-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ The database dump is also used by all our automated tests.

## Adding update bot to your project

### Artifact action
### 1. Add required secrets

Go to your repository's Settings -> Secrets and variables -> Actions.

Add a secret called `AUTOMATIC_UPDATE_TOKEN`. The value can be found from [Confluence](https://helsinkisolutionoffice.atlassian.net/wiki/spaces/HEL/pages/8354005224/Tunnusten+salasanojen+ja+muiden+avainten+jakaminen) under `AUTOMATIC_UPDATE_TOKEN` section.

### 2. Enable Artifact action

Enable the `artifact` action by adding [.github/workflows/artifact.yml](/.github/workflows/artifact.yml.dist) file to your repository. *NOTE*: `.github/workflows/artifact.yml.dist` might already exist, if it does then you can just rename it to `artifact.yml`.

Expand All @@ -57,7 +63,7 @@ This will generate an SQL-dump based on your site's current configuration and sa

The action will be run automatically once a week after you first run it.

### Update config action
### 3. Enable Update config action

Enable the `update-config` action by adding [.github/workflows/update-config.yml](/.github/workflows/update-config.yml.dist) file to your repository. *NOTE*: `.github/workflows/update-config.yml.dist` might already exist, if it does then you can just rename it to `update-config.yml`.

Expand Down