Skip to content

Commit

Permalink
Merge pull request #151 from entelecheia/main
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia authored Jul 18, 2024
2 parents 7e55e0d + 18655db commit ab089cf
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
poetry run semantic-release publish --verbosity=DEBUG --define=branch=${{ env.BRANCH }}
poetry run semantic-release publish --verbosity=DEBUG
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY_USERNAME: __token__
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<!--next-version-placeholder-->

## v0.39.4 (2024-07-17)

### Fix

* **chezmoidata:** Change gpg-suite from to optional ([`def18fb`](https://github.com/entelecheia/dotfiles/commit/def18fb836ec0cfed8a0605f21aeef27d2aebb0a))

## v0.39.3 (2024-07-17)

### Fix
Expand Down
2 changes: 1 addition & 1 deletion chezmoi/.chezmoidata.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DOTFILES_VERSION: 0.39.3
DOTFILES_VERSION: 0.39.4
packages:
- name: 1password-cli
apt: true
Expand Down
45 changes: 25 additions & 20 deletions chezmoi/dot_local/bin/executable_github-auth.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,23 @@ usage() {
exit 1
}

while (( "$#" )); do
while (("$#")); do
case "$1" in
--interactive|-i)
INTERACTIVE=true
shift
;;
--reset|-r)
RESET=true
shift
;;
--help|-h)
usage
;;
*)
echo "Error: Invalid argument"
usage
--interactive | -i)
INTERACTIVE=true
shift
;;
--reset | -r)
RESET=true
shift
;;
--help | -h)
usage
;;
*)
echo "Error: Invalid argument"
usage
;;
esac
done

Expand All @@ -47,15 +48,19 @@ if [[ -z "${GITHUB_USERNAME}" ]]; then
log_info "GITHUB_USERNAME environment variable is not set. Skipping GitHub authentication."
exit 0
fi
if [[ -z "${GITHUB_TOKEN}" ]] || [[ "${GITHUB_TOKEN}" == "null" ]] || [[ "${GITHUB_TOKEN}" == "NULL" ]]; then
unset GITHUB_TOKEN
unset GH_TOKEN
fi
if ! command -v gh >/dev/null; then
log_info "gh is not installed. Skipping GitHub authentication."
exit 0
fi

if [[ "${RESET}" == "true" ]]; then
log_info "Resetting GitHub authentication"
export GITHUB_TOKEN=""
export GH_TOKEN=""
unset GITHUB_TOKEN
unset GH_TOKEN
fi

c gh config set -h github.com git_protocol https
Expand All @@ -72,9 +77,9 @@ if [[ "${INTERACTIVE}" == "true" ]]; then
export GH_TOKEN="${GITHUB_TOKEN}"
else
if [[ -n "${GITHUB_TOKEN}" ]]; then
log_info "Logging in to GitHub"
GITHUB_TOKEN="{{ .github.token }}"
echo "${GITHUB_TOKEN}" | gh auth login --with-token || true
log_info "Logging in to GitHub"
GITHUB_TOKEN="{{ .github.token }}"
echo "${GITHUB_TOKEN}" | gh auth login --with-token || true
else
log_manual_action "GITHUB_TOKEN environment variable is not set. Run this again with the --interactive flag to login to GitHub."
fi
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dotfiles"
version = "0.39.3"
version = "0.39.4"
description = "Easily manage and synchronize your dotfiles across multiple environments with the Dotfiles project, streamlining your development setup and CI/CD pipeline."
authors = ["Young Joon Lee <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit ab089cf

Please sign in to comment.