Skip to content

CI: test sparse-checkout #21

CI: test sparse-checkout

CI: test sparse-checkout #21

Workflow file for this run

name: Changed Data Files - Develop
on:
push:
branches:
- develop
paths:
- '.github/workflows/**'
- 'src/_data/**.js'
- 'src/_data/**.yml'
- 'src/pages/api/**.njk'
- 'src/_includes/modules/api-config.njk'
jobs:
create_pr:
runs-on: ubuntu-latest
name: Create PR
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: api/dev
# sparse-checkout: |
# .github/workflows/**
# src/_data/**.js
# src/_data/**.yml
# src/pages/api/**.njk
# src/_includes/modules/api-config.njk
# !src/scss
# !src/js
# sparse-checkout-cone-mode: false
- name: Reset develop branch
run: |
git fetch origin develop
git reset --hard
git checkout develop
git sparse-checkout set --no-cone '.github/workflows/**' 'src/_data/**.js' 'src/_data/**.yml' 'src/pages/api/**.njk' '/src/_includes/modules/api-config.njk'
- name: set datestamp
id: datestamp
run: |
echo "datestamp=$(date --rfc-3339=date)" >> $GITHUB_OUTPUT
- name: Set PR message
id: message
run: |
title="[Auto PR]: ${{ steps.datestamp.outputs.datestamp }} Update API - Dev"
body="This PR was auto-generated on ${{ steps.datestamp.outputs.datestamp }} \
by [create-pull-request](https://github.com/peter-evans/create-pull-request)."
echo "title=$title" >> $GITHUB_OUTPUT
echo "body=$body" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
branch: auto/api/dev
title: ${{ steps.message.outputs.title }}
body: ${{ steps.message.outputs.body }}