|
37 | 37 | echo "Directory '$dir' bestaat niet, wordt overgeslagen." |
38 | 38 | fi |
39 | 39 | done |
40 | | - |
41 | 40 |
|
42 | 41 | - name: Extract & validate publishing metadata |
43 | 42 | id: metadata |
|
64 | 63 | SPEC_TYPE=$(get_value_lower 'specType') |
65 | 64 | SHORT_NAME=$(get_value_lower 'shortName') |
66 | 65 | PUBLISH_DATE=$(get_value_lower 'publishDate') |
67 | | -
|
| 66 | + |
| 67 | + if [[ "$SPEC_STATUS" == "wv" ]]; then |
| 68 | + echo "::error title=Ongeldige status voor publicatie::Document met status 'wv' (Werkversie) mag niet gepubliceerd worden." |
| 69 | + exit 1 |
| 70 | + fi |
| 71 | + |
68 | 72 | # 3. Check op ontbrekende waarden |
69 | 73 | MISSING=() |
70 | 74 | for VAR in DOMAIN SPEC_STATUS SPEC_TYPE SHORT_NAME PUBLISH_DATE; do |
@@ -147,28 +151,31 @@ jobs: |
147 | 151 | mkdir -p docs.geostandaarden.nl/${{ steps.metadata.outputs.folderPath }} |
148 | 152 | cp -r content/* docs.geostandaarden.nl/${{ steps.metadata.outputs.folderPath }}/ |
149 | 153 | rm docs.geostandaarden.nl/${{ steps.metadata.outputs.folderPath }}/js/config.js |
150 | | - - name: Bepaal doelbranch voor PR |
151 | | - id: branch |
| 154 | + - name: Push naar develop bij pre-release |
| 155 | + if: ${{ github.event.release.prerelease == true }} |
152 | 156 | run: | |
153 | | - if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then |
154 | | - echo "branch=develop" >> $GITHUB_OUTPUT |
155 | | - else |
156 | | - echo "branch=main" >> $GITHUB_OUTPUT |
157 | | - fi |
158 | | -
|
159 | | - - name: Create PR |
| 157 | + cd docs.geostandaarden.nl |
| 158 | + git config user.name "${{ github.actor }}" |
| 159 | + git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" |
| 160 | + git checkout develop || git checkout -b develop origin/develop |
| 161 | + git add . |
| 162 | + git commit -m "Automatische pre-release update van ${{ github.repository }}" |
| 163 | + git push origin develop |
| 164 | +
|
| 165 | + - name: Create PR naar main bij release |
| 166 | + if: ${{ github.event.release.prerelease != true }} |
160 | 167 | uses: peter-evans/create-pull-request@v5 |
161 | 168 | with: |
162 | 169 | token: ${{ secrets.GH_PUSH_TOKEN }} |
163 | 170 | path: docs.geostandaarden.nl |
164 | 171 | branch: auto-update-${{ github.run_id }} |
165 | | - base: ${{ steps.branch.outputs.branch }} |
| 172 | + base: main |
166 | 173 | author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> |
167 | | - title: "Automated update from ${{ github.repository }} to ${{ steps.branch.outputs.branch }}" |
| 174 | + title: "Automated update from ${{ github.repository }} to main" |
168 | 175 | body: | |
169 | 176 | Update vanuit workflow voor domein ${{ steps.metadata.outputs.pubdomain }} |
170 | 177 | Folder: `${{ steps.metadata.outputs.folderPath }}` |
171 | | - To branch: `${{ steps.branch.outputs.branch }}` |
| 178 | + To branch: `main` |
172 | 179 | labels: automated pr |
173 | 180 | delete-branch: true |
174 | 181 | reviewers: wilkoquak,fterpstra,lvdbrink |
0 commit comments