-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (38 loc) · 1.18 KB
/
main.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
name: Mise à jour GTFS
on:
workflow_dispatch:
jobs:
gtfs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '20'
- name: Prepare node
run: |-
npm install
npm run prepare
- name: Checkout and create latest-data branch
run: git checkout -b latest-data
- name: Generate GTFS
run: node src/index.js
- id: vars
run: |-
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
timestamp=$(date -u)
# Set title and body for PR
echo "pr_title=Latest data: ${timestamp}" >> $GITHUB_OUTPUT
echo "pr_body=Les données ont été mises à jour!" >> $GITHUB_OUTPUT
git diff --name-status
git add -A
git commit -m "Latest data: ${timestamp}" || exit 0
# git push
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: ${{ steps.vars.outputs.pr_title }}
body: ${{ steps.vars.outputs.pr_body }}
branch: main
delete-branch: true