Skip to content

Bump actions/checkout from 4 to 5 #20

Bump actions/checkout from 4 to 5

Bump actions/checkout from 4 to 5 #20

on:

Check failure on line 1 in .github/workflows/commit-sqlx-changes.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/commit-sqlx-changes.yml

Invalid workflow file

(Line: 76, Col: 13): Unrecognized named-value: 'OUTPUT1'. Located at position 1 within expression: OUTPUT1 == 'need_or', (Line: 86, Col: 11): 'title' is already defined
pull_request_target:
branches:
- master
types: [closed]
env:
RUST_BACKTRACE: 1
RUST_CACHE_KEY: rust-cache-20241114
DOCSRS_PREFIX: ignored/cratesfyi-prefix
DOCSRS_DATABASE_URL: postgresql://cratesfyi:password@localhost:15432
DOCSRS_LOG: docs_rs=debug,rustwide=info
AWS_ACCESS_KEY_ID: cratesfyi
AWS_SECRET_ACCESS_KEY: secret_key
S3_ENDPOINT: http://localhost:9000
DOCSRS_INCLUDE_DEFAULT_TARGETS: false
DOCSRS_DOCKER_IMAGE: ghcr.io/rust-lang/crates-build-env/linux-micro
SENTRY_ENVIRONMENT: dev
permissions:
contents: write
pull-requests: write
jobs:
commit-sqlx-changes:
if: ${{ github.event.pull_request.merged }}
runs-on: ubuntu-latest
outputs:
output1: $
steps:
- uses: actions/checkout@v5
- name: install `just`
run: sudo snap install --edge --classic just
- name: restore build & cargo cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ env.RUST_CACHE_KEY }}
- name: Launch postgres
run: |
cp .env.sample .env
mkdir -p ${DOCSRS_PREFIX}/public-html
docker compose up -d db s3
# Give the database enough time to start up
sleep 5
# Make sure the database is actually working
psql "${DOCSRS_DATABASE_URL}"
- name: install SQLX CLI
run: cargo install sqlx-cli --no-default-features --features postgres
- name: run database migrations
run: cargo sqlx migrate run --database-url $DOCSRS_DATABASE_URL
- name: Commit sqlx changes on master branch if any
run: |
just sqlx-prepare
# If there are differences in the SQLX files, then we push them on the master branch
if git status --porcelain .sqlx ; then
echo "need_pr" >> "$GITHUB_OUTPUT"
fi
- name: Clean up the database
run: docker compose down --volumes
create-pull-request:
if: ${{ github.event.pull_request.merged }}
needs: commit-sqlx-changes
runs-on: ubuntu-latest
env:
OUTPUT1: $
steps:
- name: Open pull request
if: ${{ OUTPUT1 == 'need_or' }}
uses: peter-evans/create-pull-request@v7
with:
commit-message: Update SQLX files
committer: Docs.rs developers <[email protected]>
author: Docs.rs developers <[email protected]>
signoff: false
title: Update SQLX files
delete-branch: true
branch: update-sqlx-pr-${{ github.event.pull_request.number }}
title: Update SQLX files after #${{ github.event.pull_request.number }} changes
body: |
Following #${{ github.event.pull_request.number }} changes, here are the related SQLX files changes.