From 2583b77f414c119b1aa7eb9300fcea7b49661359 Mon Sep 17 00:00:00 2001 From: Marten Lohstroh Date: Tue, 29 Aug 2023 14:30:18 -0700 Subject: [PATCH] Add actions for setting up francabot --- .github/actions/setup-francabot/action.yml | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/actions/setup-francabot/action.yml diff --git a/.github/actions/setup-francabot/action.yml b/.github/actions/setup-francabot/action.yml new file mode 100644 index 0000000000..7f2e2b86ab --- /dev/null +++ b/.github/actions/setup-francabot/action.yml @@ -0,0 +1,34 @@ +name: Load global configuration settings for francabot +description: Set up author information and GPG signature +author: Marten Lohstroh + +inputs: + gpg-key: + description: 'francabot GPG key' + required: true + gpg-passphrase: + description: 'francabot GPG passphrase' + required: true + +runs: + using: composite + steps: + - name: Set environment variables + run: | + echo "username=lingua-franca[bot]" >> "$GITHUB_ENV" + echo "email=97201490+francabot@users.noreply.github.com" >> "$GITHUB_ENV" + echo "user-and-email=lingua-franca[bot] <97201490+francabot@users.noreply.github.com>" >> "$GITHUB_ENV" + shell: bash + - name: Configure git username and email + run: | + git config --global user.name '${{ env.username }}' + git config --global user.email '${{ env.email }}' + shell: bash + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ inputs.gpg-key }} + passphrase: ${{ inputs.gpg-passphrase }} + git_config_global: true + git_user_signingkey: true + git_commit_gpgsign: true