-
Notifications
You must be signed in to change notification settings - Fork 2
feat: create dev_daily workflow to sync workflows #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d23e3a2
create dev_daily workflow
amoeba 82941fc
Update adbc_drivers_dev/templates/dev_daily.yaml
amoeba 6ad4fe3
Update adbc_drivers_dev/templates/dev_daily.yaml
amoeba ac0e306
Remove body from PR
amoeba 9e383d3
use uvx instead of python
amoeba 1959e7a
add error handling
amoeba 1abb348
Ensure we only run on upstream (not forks)
amoeba 2f1d0a9
Only git add workflow changes
amoeba be481ab
shell safety
amoeba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| <% if private %> | ||
| # Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. | ||
| <% else %> | ||
| # Copyright (c) 2025 ADBC Drivers Contributors | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| <% endif %> | ||
|
|
||
| # This is a common workflow synchronizing workflows in driver repositories. | ||
|
|
||
| name: Dev (Daily) | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: 14 23 * * * | ||
|
|
||
| concurrency: | ||
| group: ${{ github.repository }} | ||
| cancel-in-progress: true | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| sync_workflows: | ||
| name: Sync Workflows | ||
| runs-on: ubuntu-slim | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| fetch-depth: 1 | ||
| persist-credentials: true # for git operations below | ||
|
|
||
| - name: Re-generate workflows | ||
| run: | | ||
| python -m venv venv | ||
| source venv/bin/activate | ||
| pip install git+https://github.com/adbc-drivers/dev.git | ||
| adbc-gen-workflow generate $(pwd) | ||
|
|
||
| - name: Create PR if there are any changes | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| if [ -n "$(git status --porcelain)" ]; then | ||
| PR_TITLE="chore: update generated workflows" | ||
| BRANCH="chore/workflows_$(date +%Y-%m-%d)" | ||
|
|
||
| # Skip if branch already exists on remote | ||
| if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then | ||
| echo "Branch $BRANCH already exists on remote. Skipping creating a new PR." | ||
| exit 0 | ||
| fi | ||
|
|
||
| git config user.name "github-actions" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git checkout -b $BRANCH | ||
| git add . | ||
| git commit -m "update generated workflows" | ||
| git push origin $BRANCH | ||
|
|
||
| gh pr create \ | ||
| --base main \ | ||
| --head $BRANCH \ | ||
| --title "$PR_TITLE" \ | ||
| --body "TODO" \ | ||
amoeba marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --dry-run | ||
amoeba marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| else | ||
| echo "No changes to commit. Skipping creating a PR." | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.