Skip to content

Commit

Permalink
add pipeline for resetting user's 2FA
Browse files Browse the repository at this point in the history
  • Loading branch information
rikukissa committed Jan 4, 2024
1 parent f2bbb66 commit f5d1f67
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/reset-2fa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Provision environment
run-name: Provision ${{ github.event.inputs.environment }}
on:
workflow_dispatch:
inputs:
user:
description: User to remove 2FA from
required: true
environment:
type: choice
description: Machine to provision
default: qa
required: true
options:
- development
- staging
- qa
- production

jobs:
provision:
environment: ${{ github.event.inputs.environment }}
runs-on: ubuntu-20.04
outputs:
outcome: ${{ steps.deploy.outcome }}
timeout-minutes: 60
steps:
- name: Read known hosts
run: |
cd ${{ github.event.repository.name }}
echo "KNOWN_HOSTS<<EOF" >> $GITHUB_ENV
sed -i -e '$a\' ./infrastructure/.known-hosts
cat ./infrastructure/.known-hosts >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ env.KNOWN_HOSTS }}

- name: Remove 2FA
run: |
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} -p ${{ secrets.SMTP_PORT }} "rm /home/${{ github.event.inputs.user }}/.google_authenticator"

0 comments on commit f5d1f67

Please sign in to comment.