-
Notifications
You must be signed in to change notification settings - Fork 8
56 lines (56 loc) · 1.61 KB
/
Copy pathansible-requirements.yml
File metadata and controls
56 lines (56 loc) · 1.61 KB
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
name: Ansible Requirements
on:
push:
branches: [main]
paths: ["ansible/**"]
workflow_dispatch:
permissions:
contents: read
jobs:
poetry:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Poetry
run: pipx install poetry
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
cache: "poetry"
- name: Poetry Install
run: poetry install
working-directory: ./ansible
- name: Install the project dependencies
run: poetry export --without-hashes --format=requirements.txt > requirements.txt
working-directory: ./ansible
- name: Upload Artifact
uses: actions/upload-artifact@v7
with:
name: requirements
path: ansible/requirements.txt
commit:
runs-on: ubuntu-latest
needs: poetry
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.head_ref }}
- name: Download Artifact
uses: actions/download-artifact@v8
with:
name: requirements
path: ./ansible/
- name: Commit changes
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add ansible/requirements.txt
git commit -m "Update requirements.txt"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}