Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 0 additions & 130 deletions .github/actions/reaction/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion DEVGUIDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Developer Guide

> [!WARNING]
> [!CAUTION]
> This extension is a research demonstrator. It is in early development and may change significantly. It has not been thoroughly tested. Using agentic workflows in your repository requires careful supervision, and even then things can still go wrong. Use it with caution, and at your own risk.

This guide provides comprehensive information for developers working on gh-aw, including setup, development workflow, testing, and contribution guidelines.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Write agentic workflows in natural language markdown, and run them in GitHub Actions. From [GitHub Next](https://githubnext.com/).

> [!WARNING]
> [!CAUTION]
> This extension is a research demonstrator. It is in early development and may change significantly. It has not been thoroughly tested. Using agentic workflows in your repository requires careful supervision, and even then things can still go wrong. Use it with caution, and at your own risk.

## ⚡ Quick Start (30 seconds)
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 📖 GitHub Agentic Workflows Documentation

> [!WARNING]
> [!CAUTION]
> This extension is a research demonstrator. It is in early development and may change significantly. It has not been thoroughly tested. Using agentic workflows in your repository requires careful supervision, and even then things can still go wrong. Use it with caution, and at your own risk.

Complete documentation for creating and managing agentic workflows with GitHub Actions.
Expand Down
58 changes: 18 additions & 40 deletions pkg/workflow/templates/check_team_member.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,27 @@ runs:
const actor = context.actor;
const { owner, repo } = context.repo;

console.log(`Checking if user '${actor}' is a member of organization '${owner}'`);

// Check if the actor has repository access (admin, maintain permissions)
try {
// First, check if the actor has repository access (admin, write, maintain permissions)
try {
const repoPermission = await github.rest.repos.getCollaboratorPermissionLevel({
owner: owner,
repo: repo,
username: actor
});

const permission = repoPermission.data.permission;
console.log(`Repository permission level: ${permission}`);

if (permission === 'admin' || permission === 'write' || permission === 'maintain') {
console.log(`User has ${permission} access to repository`);
core.setOutput('is_team_member', 'true');
return;
}
} catch (repoError) {
console.log(`Repository permission check failed: ${repoError.message}`);
// Continue to org membership check
}
console.log(`Checking if user '${actor}' is admin or maintainer of ${owner}/${repo}`);

const repoPermission = await github.rest.repos.getCollaboratorPermissionLevel({
owner: owner,
repo: repo,
username: actor
});

// Fallback: check organization membership
try {
await github.rest.orgs.getMembershipForUser({
org: owner,
username: actor
});
console.log(`User is a member of organization ${owner}`);
const permission = repoPermission.data.permission;
console.log(`Repository permission level: ${permission}`);

if (permission === 'admin' || permission === 'maintain') {
console.log(`User has ${permission} access to repository`);
core.setOutput('is_team_member', 'true');
return;
} catch (orgError) {
console.log(`Organization membership check failed: ${orgError.message}`);
}
} catch (repoError) {
console.log(`Repository permission check failed: ${repoError.message}`);
}

core.setOutput('is_team_member', 'false');

// If both checks failed, user is not a team member
console.log('User is not a team member (no repository access and not org member)');
core.setOutput('is_team_member', 'false');

} catch (error) {
console.error(`Error checking team membership: ${error.message}`);
// Default to false on error for security
core.setOutput('is_team_member', 'false');
}
23 changes: 23 additions & 0 deletions pkg/workflow/templates/compute_text_action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,29 @@ runs:
with:
script: |
let text = '';

const actor = context.actor;
const { owner, repo } = context.repo;

// Check if the actor has repository access (admin, maintain permissions)
try {
const repoPermission = await github.rest.repos.getCollaboratorPermissionLevel({
owner: owner,
repo: repo,
username: actor
});

const permission = repoPermission.data.permission;
console.log(`Repository permission level: ${permission}`);

if (permission !== 'admin' && permission !== 'maintain') {
return;
}
} catch (repoError) {
console.log(`Repository permission check failed: ${repoError.message}`);
core.setOutput('text', '');
return;
}

// Determine current body text based on event context
switch (context.eventName) {
Expand Down
Loading