Copilot Coding Agent session overwrites custom actions/checkout options silently #163397
Replies: 7 comments 2 replies
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
experiencing the same issue in microsoft/qcodes repo |
Beta Was this translation helpful? Give feedback.
-
|
@darcien Nice workaround, thanks I will try this. This decision to not persist git credentials has obviously been made deliberately (for security?) and it would be great for github to at least provide their reasoning and whether this feature loss is likely to be long-term. The impact is huge. Here's a run from June where the author says Now the agent can only say something like:
This is a very poor experience |
Beta Was this translation helpful? Give feedback.
-
|
As of this week, it seems However, if the setup checkout As it seems the agent is operating on a fork, this workaround is allowing me to direct the agent to update the head branch: # .github/workflows/copilot-setup-steps.yml
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Get base branch name
if: ${{ github.event_name == 'dynamic' && inputs.github-token }}
id: base
shell: bash
run: |
BRANCH=$(echo $COPILOT_AGENT_INPUTS | jq -r '.COPILOT_AGENT_BASE_COMMIT')
echo "branch=$(echo "$BRANCH" | sed 's#refs/heads/##')" >> "$GITHUB_OUTPUT"
env:
COPILOT_AGENT_INPUTS: ${{ github.event.inputs.COPILOT_AGENT_INPUTS }}
- name: Fetch base branch (workaround allowing agent to update with base)
if: ${{ github.event_name == 'dynamic' && inputs.github-token }}
shell: bash
run: |
git remote add upstream https://x-access-token:$TOKEN@github.com/$GITHUB_REPOSITORY.git
git fetch upstream $BASE
env:
BASE: ${{ steps.base.branch }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}So prompts like "@copilot merge in upstream branch, fix conflicts, pick mine" seems to work |
Beta Was this translation helpful? Give feedback.
-
|
I was struck by the same thing recently. I need |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
-
|
This behavior is documented, for what it's worth:
I'm finding that Copilot Coding Agent can't run - name: Checkout repository
uses: actions/checkout@v5
# Copilot sets its own `fetch-depth` setting, no point in setting it here as it would be overriddenI had it run Update: even when I explicitly set As a result, Copilot coding agent is unable to push its changes in my main monorepo! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Product Feedback
Copilot Feature Area
Copilot Agent Mode
Body
Problems
I have a custom
.github/workflows/copilot-setup-steps.ymlwithactions/checkout@v4step.From my understanding, the steps in the
copilot-setup-stepsshould have no restriction.But from my observation, when Copilot Coding Agent starts a new session,
actions/checkout@v4custom options are being overwritten.I'll give an example
These options are respected just fine if the workflow runs are triggered not via agent session, e.g. via PR push. Even if the one pushing the PR is the coding agent. I've tested it because I'm making these changes using agent.
This is the log after agent pushed the updates:
After custom workflow has been merged, I created a new issue and assigned copilot to it.
Note how the options for
actions/checkoutare overwritten in the agent session:Questions
Expectations
Use case
Specific to my use case, I need other branches to be available locally in the agent session.
The common solution here is use the persisted git credentials from
actions/checkoutin next step to manually callgit fetch. These credentials will be cleaned up in the post job step automatically anyway.Workaround?
As temporary workaround, I'm using the built in GH token from the action env to authenticate with GH and do fetch.
Beta Was this translation helpful? Give feedback.
All reactions