-
Notifications
You must be signed in to change notification settings - Fork 62
73 lines (61 loc) · 2.15 KB
/
oui_filepull.yml
File metadata and controls
73 lines (61 loc) · 2.15 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
name: "OUI-Updates"
on: # yamllint disable-line rule:truthy
schedule:
- cron: "0 2 1 * *"
workflow_dispatch: {}
jobs:
data_gathering:
runs-on: "ubuntu-latest"
env:
BRANCH_NAME: "OUI_Updates"
steps:
- name: "Check out code"
uses: "actions/checkout@v4"
with:
ref: "ab_oui_updates"
fetch-depth: 0
- name: "Authenticate git remote"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
- name: "Delete existing branch"
run: |
git branch -D "$BRANCH_NAME" || true
- name: "Create branch"
run: |
git checkout -b "$BRANCH_NAME"
- name: "Push branch"
run: |
git push -f --set-upstream origin "$BRANCH_NAME"
# Fetch data via curl as IEEE has blocked requests/urllib library requests
- name: "Download IEEE OUI data"
run: |
curl -fsSL "https://standards-oui.ieee.org/oui/oui.csv" \
-o "./netutils/data_files/oui_mappings.py"
- name: "Generate oui_mappings.py"
run: "python ./flat_postprocess/oui_postprocess.py ./netutils/data_files/oui_mappings.py"
- name: "Commit changes"
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add ./netutils/data_files/oui_mappings.py
git diff --cached --quiet || git commit -m "Update OUI mappings"
- name: "Push changes"
run: |
git push origin "$BRANCH_NAME"
pr_creation:
runs-on: "ubuntu-latest"
needs: "data_gathering"
steps:
# Checkout repo
- name: "Check out code"
uses: "actions/checkout@v4"
with:
ref: "OUI_Updates"
# Create PR from branch created above into develop
- name: "Create a Pull Request"
run: "gh pr create -B develop -H OUI_Updates --title 'Flatbot OUI File Updates' --body 'Created by Flatbot action'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"