forked from netbox-community/devicetype-library
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 1.45 KB
/
master-slugs.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
---
name: Create Master Slug List on PR Merge
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
id: setup_python
with:
python-version: '3.8'
- name: cache virtualenv
uses: actions/cache@v3
id: cache-venv
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.pythonLocation }}-
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
if: steps.cache-venv.outputs.cache-hit != 'true'
- name: Regenerate Master Slug List
run: python3 tests/generate-slug-list.py
- name: Commit and Push Changes to Master
uses: EndBug/add-and-commit@v9
with:
author_name: NetBox-Bot
author_email: info@netboxlabs.com
committer_name: NetBox-Bot
committer_email: info@netboxlabs.com
default_author: github_actions
message: "Regenerate master slug list after successful PR merge"
push: true