Bump the development-dependencies group with 3 updates (#89) #350
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: Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main, '[0-9]+-[0-9]+-*'] | |
workflow_dispatch: | |
workflow_run: | |
workflows: ['Dependabot'] | |
branches-ignore: ['workflows/tests/*'] | |
types: | |
- completed | |
workflow_call: | |
jobs: | |
test-with-github-actions-token: | |
name: Test with GitHub Actions Token | |
if: ${{ !startsWith(github.head_ref, 'workflows/tests/') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name != 'workflow_run' }} | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name == 'workflow_run' }} | |
with: | |
ref: ${{ github.event.workflow_run.head_branch }} | |
- name: Test with GitHub Actions token | |
id: test | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Verify name and email | |
env: | |
TEST_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
GIT_USER_NAME=$(git config --get user.name) | |
if [[ "$GIT_USER_NAME" != "GitHub Actions" ]] | |
then | |
echo "::error::Expected git config user.name to be 'GitHub Actions' but got '$GIT_USER_NAME'" | |
exit 1 | |
fi | |
GIT_USER_EMAIL=$(git config --get user.email) | |
if [[ "$GIT_USER_EMAIL" != "41898282+github-actions[bot]@users.noreply.github.com" ]] | |
then | |
echo "::error::Expected git config user.email to be '41898282+github-actions[bot]@users.noreply.github.com' but got '$GIT_USER_EMAIL'" | |
exit 1 | |
fi | |
- name: Verify remote access | |
run: | | |
git ls-remote origin | |
gh repo view | |
test-with-user-app-installation-token: | |
name: Test with User App Installation Token | |
if: ${{ !startsWith(github.head_ref, 'workflows/tests/') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/create-github-app-token@v1 | |
id: get-github-app-token | |
with: | |
app-id: ${{ secrets.CHECK_GIT_STATUS_BOT_APP_ID }} | |
private-key: ${{ secrets.CHECK_GIT_STATUS_BOT_APP_PRIVATE_KEY }} | |
owner: ${{ github.repository_owner }} | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name != 'workflow_run' }} | |
with: | |
token: ${{ steps.get-github-app-token.outputs.token }} | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name == 'workflow_run' }} | |
with: | |
ref: ${{ github.event.workflow_run.head_branch }} | |
token: ${{ steps.get-github-app-token.outputs.token }} | |
- name: Test | |
id: test | |
uses: ./ | |
with: | |
github-token: ${{ steps.get-github-app-token.outputs.token }} | |
- name: Verify name and email | |
env: | |
TEST_TOKEN: ${{ steps.get-github-app-token.outputs.token }} | |
run: | | |
GIT_USER_NAME=$(git config --get user.name) | |
if [[ "$GIT_USER_NAME" != "Check Git Status Bot" ]] | |
then | |
echo "::error::Expected git config user.name to be 'Check Git Status Bot' but got '$GIT_USER_NAME'" | |
exit 1 | |
fi | |
GIT_USER_EMAIL=$(git config --get user.email) | |
if [[ "$GIT_USER_EMAIL" != "172423145+check-git-status-bot[bot]@users.noreply.github.com" ]] | |
then | |
echo "::error::Expected git config user.email to be '172423145+check-git-status-bot[bot]@users.noreply.github.com' but got '$GIT_USER_EMAIL'" | |
exit 1 | |
fi | |
- name: Verify remote access | |
run: | | |
git ls-remote origin | |
gh repo view | |
test-with-repo-app-installation-token: | |
name: Test with Repo App Installation Token | |
if: ${{ !startsWith(github.head_ref, 'workflows/tests/') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/create-github-app-token@v1 | |
id: get-github-app-token | |
with: | |
app-id: ${{ secrets.CHECK_GIT_STATUS_BOT_APP_ID }} | |
private-key: ${{ secrets.CHECK_GIT_STATUS_BOT_APP_PRIVATE_KEY }} | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name != 'workflow_run' }} | |
with: | |
token: ${{ steps.get-github-app-token.outputs.token }} | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name == 'workflow_run' }} | |
with: | |
ref: ${{ github.event.workflow_run.head_branch }} | |
token: ${{ steps.get-github-app-token.outputs.token }} | |
- name: Test | |
id: test | |
uses: ./ | |
with: | |
github-token: ${{ steps.get-github-app-token.outputs.token }} | |
- name: Verify name and email | |
env: | |
TEST_TOKEN: ${{ steps.get-github-app-token.outputs.token }} | |
run: | | |
GIT_USER_NAME=$(git config --get user.name) | |
if [[ "$GIT_USER_NAME" != "Check Git Status Bot" ]] | |
then | |
echo "::error::Expected git config user.name to be 'Check Git Status Bot' but got '$GIT_USER_NAME'" | |
exit 1 | |
fi | |
GIT_USER_EMAIL=$(git config --get user.email) | |
if [[ "$GIT_USER_EMAIL" != "172423145+check-git-status-bot[bot]@users.noreply.github.com" ]] | |
then | |
echo "::error::Expected git config user.email to be '172423145+check-git-status-bot[bot]@users.noreply.github.com' but got '$GIT_USER_EMAIL'" | |
exit 1 | |
fi | |
- name: Verify remote access | |
run: | | |
git ls-remote origin | |
gh repo view | |
test-with-classic-personal-access-token: | |
name: Test with Classic Personal Access Token | |
if: ${{ !startsWith(github.head_ref, 'workflows/tests/') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name != 'workflow_run' }} | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name == 'workflow_run' }} | |
with: | |
ref: ${{ github.event.workflow_run.head_branch }} | |
- name: Test | |
id: test | |
uses: ./ | |
with: | |
github-token: ${{ secrets.CLASSIC_PERSONAL_ACCESS_TOKEN }} | |
- name: Verify name and email | |
run: | | |
GIT_USER_NAME=$(git config --get user.name) | |
if [[ "$GIT_USER_NAME" != "Cat Chen" ]] | |
then | |
echo "::error::Expected git config user.name to be 'Cat Chen' but got '$GIT_USER_NAME'" | |
exit 1 | |
fi | |
GIT_USER_EMAIL=$(git config --get user.email) | |
if [[ "$GIT_USER_EMAIL" != "catchen@catchen.me" ]] | |
then | |
echo "::error::Expected git config user.email to be 'catchen@catchen.me' but got '$GIT_USER_EMAIL'" | |
exit 1 | |
fi | |
- name: Verify remote URL | |
env: | |
TEST_TOKEN: ${{ secrets.CLASSIC_PERSONAL_ACCESS_TOKEN }} | |
run: | | |
GIT_REMOTE_URL=$(git remote get-url origin) | |
if [[ ! "$GIT_REMOTE_URL" =~ ^'https://CatChen' ]] | |
then | |
echo "::error::Expected git remote url to have login and token but got '$GIT_REMOTE_URL'" | |
exit 1 | |
fi | |
if [[ ! "$GIT_REMOTE_URL" =~ ^'https://CatChen:'"$TEST_TOKEN" ]] | |
then | |
echo "::error::Expected git remote url to have token but got '$GIT_REMOTE_URL'" | |
exit 1 | |
fi | |
- name: Verify remote access | |
run: | | |
git ls-remote origin | |
gh repo view |