-
Notifications
You must be signed in to change notification settings - Fork 68
65 lines (56 loc) · 2.15 KB
/
metadata-refresh.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Metadata Refresh
on:
workflow_dispatch:
inputs:
environment:
description: 'The environment to run the workflow in'
required: true
type: choice
default: 'preview'
options:
- 'preview'
- 'production'
schedule:
- cron: '0 12 * * 1' # Run at midnight UTC on Mondays
jobs:
metadata_refresh:
name: Metadata Refresh
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment || github.event_name == 'schedule' && 'production' || 'preview' }}
env:
AWS_S3_BUCKET: "${{ secrets.HUB_METADATA_S3_BUCKET }}"
permissions:
id-token: write # This is required for requesting the JWT
steps:
- uses: actions/[email protected]
- name: Configure AWS credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: us-west-2
role-session-name: "GitHubActions"
- name: Install hub-utils
run: pipx install git+https://github.com/meltano/hub-utils.git@main
- name: Download Raw JSON Output
run: hub-utils download-metadata "/home/runner/work/downloaded_data"
- name: Merge Raw JSON and Existing Definition
run: hub-utils merge-metadata $(pwd) "/home/runner/work/downloaded_data"
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.MELTYBOT_GITHUB_AUTH_TOKEN }}
commit-message: Refresh plugin metadata ${{ steps.date.outputs.date }}
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: hub-bot-metadata-${{ steps.date.outputs.date }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
delete-branch: true
title: 'chore: [Hub Bot] Refresh metadata ${{ steps.date.outputs.date }}'
body: |
Updates Plugin Definitions
assignees: pnadolny13
reviewers: pnadolny13
draft: false