fix: resolve token validator when user logout #10
Workflow file for this run
This file contains 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
name: Merge CI | |
on: | |
pull_request: | |
types: [ closed ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --verbose --release --all-features | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --verbose --all-features | |
- name: Run cargo fmt -- --check | |
id: fmt | |
run: cargo fmt --all -- --check | |
continue-on-error: true # Continue even if formatting issues are found | |
- name: Fix formatting if needed | |
if: steps.fmt.outcome == 'failure' # Proceed only if the formatting check failed | |
run: | | |
echo "Formatting issues found. Applying automatic fixes..." | |
cargo fmt --all | |
git config --global user.name 'Lzyct-Bot' | |
git config --global user.email 'lazycatlabs@users.noreply.github.com' | |
git add . | |
git commit -m "style: apply automatic formatting" | |
git push | |
echo "Formatting issues have been automatically fixed. Please review the changes." | |
- name: Run clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: -- -W warnings | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v5 | |
- name: Check for modified files | |
id: git-check | |
run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT | |
- name: Push changes | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git config --global user.name 'Lzyct-Bot' | |
git config --global user.email 'lazycatlabs@users.noreply.github.com' | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git fetch | |
git checkout ${{ steps.branch-name.outputs.current_branch }} | |
git commit -am "style: apply formatting changes" | |
git push | |
- name: Delete branch if merged | |
if: github.event.pull_request.merged == true | |
uses: actions/github-script@v5 | |
with: | |
script: | | |
github.rest.git.deleteRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: `heads/${context.payload.pull_request.head.ref}`, | |
}) |