op item create doesnt work in GitHub Actions
When I use op item list
or op item get
in GitHub Actions, they work as expected. But when I use op item create
in GitHub Actions, it doesn't work (the item doesn't get created), and I don't get any error message either. The same command, when run locally, works just fine outside of GitHub Actions. Can anybody advise how to get op item create
to work in the context of GitHub Actions?
Note: I'm using the new Service Account beta feature.
And here is how to reproduce the problem on-demand in GitHub Actions:
name: Test 1Password on: # workflow_dispatch allows the action to be kicked off on-demand manually. workflow_dispatch: defaults: run: shell: bash jobs: add_item: runs-on: ubuntu-latest steps: - name: Check out this repo uses: actions/checkout@v3 - name: Install 1Password CLI run: | curl -sS -L --output /tmp/1p.zip https://cache.agilebits.com/dist/1P/op2/pkg/v2.10.0-beta.02/op_linux_$(dpkg --print-architecture)_v2.10.0-beta.02.zip unzip /tmp/1p.zip op -d /usr/local/bin/ rm -f /tmp/1p.zip - name: Create item in 1Password run: | set -x # This evaluates to `2.10.0-beta.02`, so presumably the CLI is installed and usable op --version # This also works as expected op item list --vault MyCustomVault --format json # And if you prepopulate an item called `bar`, this will work as expected too op item get bar --vault MyCustomVault --format json # But this doesnt create any item, and also doesnt output anything to stderr or stdout op item create --vault MyCustomVault --title foo --url "sftp://example.com" --category Login --format json "username=foo" "GitHub_Issue=${{ github.server_url }}/${{ github.repository }}/issues/${{ github.event.issue.number }}" --generate-password env: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} OP_DEBUG: "true"
1Password Version: 2.10.0-beta.02
Extension Version: Not Provided
OS Version: Ubuntu
Browser:_ Not Provided
Comments
-
Hi @jrobisonsb,
Thanks for the detailed report here. I know we've been in touch via other channels about this but wanted to post here for the community's sake. This bug is on our radar and is being investigated, but we don't yet have a firm ETA.
Thanks again for the testing and for the reproduction steps. Your feedback and bug reports are always appreciated! :)
0