Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7efc21f

Browse filesBrowse files
Add wiki workflows (Azure#120)
# Pull Request ## Issue Issue #, if available: ## Description Description of changes: ## License By submitting this pull request, I confirm that my contribution is made under the terms of the projects associated license.
1 parent 1fc52a3 commit 7efc21f
Copy full SHA for 7efc21f

File tree

Expand file treeCollapse file tree

2 files changed

+114
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+114
-0
lines changed

‎.github/workflows/super-linter.yml

Copy file name to clipboard
+49Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: Linting
3+
on:
4+
pull_request:
5+
types: ['opened', 'synchronize']
6+
merge_group:
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: linting-${{ github.event.pull_request.head.repo.full_name }}/${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
superlinter:
15+
name: super linter
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Setup Terraform
20+
uses: hashicorp/setup-terraform@v3
21+
with:
22+
terraform_version: latest
23+
terraform_wrapper: false
24+
- name: Run github/super-linter/slim
25+
uses: github/super-linter/slim@v5
26+
env:
27+
# Lint all code
28+
VALIDATE_ALL_CODEBASE: true
29+
FILTER_REGEX_EXCLUDE: '.*tests/vendor/.*'
30+
# Need to define main branch as default
31+
# is set to master in super-linter
32+
DEFAULT_BRANCH: main
33+
# Enable setting the status of each individual linter
34+
# run in the Checks section of a pull request
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
# The following linter types will be enabled:
37+
VALIDATE_BASH: true
38+
VALIDATE_BASH_EXEC: true
39+
VALIDATE_GITHUB_ACTIONS: true
40+
VALIDATE_JSON: true
41+
VALIDATE_MARKDOWN: true
42+
# VALIDATE_TERRAFORM_TERRASCAN: true # disabled for now as does not support TF 1.3 optional(type, default)
43+
VALIDATE_TERRAFORM_TFLINT: true
44+
VALIDATE_YAML: true
45+
# VALIDATE_GO: true # Disabled because it down not work :(
46+
# Additional settings:
47+
# If a shell script is not executable, the bash-exec
48+
# linter will report an error when set to true
49+
ERROR_ON_MISSING_EXEC_BIT: true

‎.github/workflows/wiki-sync.yml

Copy file name to clipboard
+65Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
name: Docs/Wiki Sync
3+
4+
permissions:
5+
contents: write
6+
7+
# yamllint disable-line rule:truthy
8+
on:
9+
release:
10+
types: [published]
11+
workflow_dispatch:
12+
13+
env:
14+
wiki_source_repo: "${{ github.repository }}"
15+
wiki_source_repo_dir: "${{ github.repository }}/docs/wiki"
16+
wiki_target_repo: "${{ github.repository }}.wiki"
17+
github_user_name: "github-actions"
18+
github_email: "github-actions@github.com"
19+
github_commit_message: "GitHub Action syncing wiki from docs/wiki"
20+
21+
jobs:
22+
sync-wiki:
23+
name: Sync Wiki
24+
if: github.repository == 'Azure/ALZ-PowerShell-Module' || github.event_name == 'workflow_dispatch'
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout Source Repo
28+
uses: actions/checkout@v3
29+
with:
30+
repository: ${{ env.wiki_source_repo }}
31+
path: ${{ env.wiki_source_repo }}
32+
33+
- name: Checkout Wiki Repo
34+
uses: actions/checkout@v3
35+
with:
36+
repository: ${{ env.wiki_target_repo }}
37+
path: ${{ env.wiki_target_repo }}
38+
39+
- name: Configure Local Git
40+
run: |
41+
git config --global user.name "$github_user_name"
42+
git config --global user.email "$github_email"
43+
working-directory: ${{ env.GITHUB_WORKSPACE }}
44+
45+
- name: Sync docs/wiki Into Wiki Repo
46+
run: |
47+
rsync -avzr --delete --exclude='.git/' "$wiki_source_repo_dir/" "$wiki_target_repo"
48+
working-directory: ${{ env.GITHUB_WORKSPACE }}
49+
50+
- name: Check for changes
51+
id: git_status
52+
run: |
53+
mapfile -t "CHECK_GIT_STATUS" < <(git status -s)
54+
printf "%s\n" "${CHECK_GIT_STATUS[@]}"
55+
echo "changes=${#CHECK_GIT_STATUS[@]}" >> "$GITHUB_OUTPUT"
56+
working-directory: ${{ env.wiki_target_repo }}
57+
58+
- name: Add files, commit and push into Wiki
59+
if: steps.git_status.outputs.changes > 0
60+
run: |
61+
echo "Pushing changes to origin..."
62+
git add .
63+
git commit -m "$github_commit_message [$GITHUB_ACTOR/${GITHUB_SHA::8}]"
64+
git push --set-upstream "https://$GITHUB_TOKEN@github.com/$wiki_target_repo.git" master
65+
working-directory: ${{ env.wiki_target_repo }}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.