-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.63 KB
/
Copy pathrelease.yml
File metadata and controls
61 lines (52 loc) · 1.63 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
name: Release
on:
workflow_dispatch:
push:
branches: [main, master]
paths:
- "src/**"
permissions:
contents: write
pull-requests: write
packages: write
jobs:
release:
name: Publish Features
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Publish Features
uses: devcontainers/action@v1
with:
publish-features: "true"
base-path-to-features: "./src"
generate-docs: "true"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Documentation PR
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
run: |
set -e
# Check if there are changes
if git diff --quiet; then
echo "No documentation changes to commit"
exit 0
fi
# Configure git
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Create branch and commit
BRANCH="docs/auto-update-${{ github.run_id }}"
git checkout -b "$BRANCH"
git add src/*/README.md
git commit -m "docs: auto-generate feature documentation [skip ci]"
git push origin "$BRANCH"
# Create PR
gh pr create \
--title "docs: auto-generate feature documentation" \
--body "Automated documentation update from workflow run ${{ github.run_id }}" \
--base "${{ github.ref_name }}" \
--head "$BRANCH"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}