This repository has been archived by the owner on Apr 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (56 loc) · 2.2 KB
/
fetch-apache-repos-with-ga.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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
---
name: Fetch Apache Repositories with GA
on: # yamllint disable-line rule:truthy
schedule:
- cron: '0 0 * * SUN'
workflow_dispatch:
inputs:
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
jobs:
fetch-apache-repos-with-ga:
name: "Fetch Apache repos with GitHub Actions"
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check is PERSONAL_ACCESS_TOKEN set
id: check-pat-variable
run: './scripts/check_are_variables_set.sh "GITHUB_TOKEN"'
- name: Stop if PERSONAL_ACCESS_TOKEN is not set
if: steps.check-pat-variable.outputs.are-variables-set != 'true'
run: echo "Variables not set! Set PERSONAL_ACCESS_TOKEN in repository secrets (see README)" && exit 1
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install requirements
run: pip install -r requirements.txt
- name: Fetch Apache repos with GitHub Actions
run: |
python scripts/fetch_apache_projects_with_ga.py \
--org apache \
--output matrix.json
- name: Commit and push if matrix changed
run: |
git config user.name "Automated"
git config user.email "[email protected]"
git add matrix.json
timestamp=$(date -u)
git commit -m "Matrix update. Latest data: ${timestamp}" || exit 0
git push